import { ChangeEvent, useMemo } from 'react' import { cn } from '@/lib/utils' import { Input } from '../ui/input' import { FormField } from './FormField' export function FormDir({ label, className, placeholder, disabled, onChange, horizontal, accept, centered, }: { label?: string className?: string placeholder?: string disabled?: boolean onChange?: (files: File[]) => void horizontal?: boolean accept?: string centered?: boolean }) { const handleChange = useMemo( () => (event: ChangeEvent) => { if (disabled) { return } if (!onChange) { return } onChange(Array.from(event.currentTarget.files || [])) }, [disabled, onChange] ) return ( ) }