import { Control, Controller, FieldPath, FieldValues, RefCallBack, UseControllerProps, } from 'react-hook-form'; import { FileInputContentBlank, FileInputContentFile } from './FileInput'; import { useElectron } from '@/hooks/electron'; export function InnerSystemFileInput({ label, value, onChange, directory, ref, }: { label: string; value: string | null; onChange: (...event: any[]) => void; directory: boolean; ref: RefCallBack; }) { const electron = useElectron(); const handleClick = async () => { if (!electron.isElectron) return; const open = await electron.api.openDialog({ properties: ['openDirectory'], }); if (open.canceled) { onChange(null); return; } onChange(open.filePaths[0]); }; return (