import type { FileInputProps } from "$/types/InputTypes"; import { humanReadableBytes } from "$/util/FileUtil"; import clsx from "clsx"; import { useEffect, useRef, useState } from "react"; export default function DragAndDropFileInput({ id, className, name, minSize, maxSize, showFileName, showSize, onChange, disabled, children }: FileInputProps){ const [ file, setFile ] = useState(); const inputRef = useRef(null); useEffect(() => { onChange?.(file); }, [ file, onChange ]); return ( ); }