"use client"; import { useRef, type ReactNode } from "react"; type Props = { children: ReactNode; accept?: string; onChange: (files: FileList | null) => void; }; function UploadWrapper({ children, accept, onChange }: Props) { const fileInputRef = useRef(null); function handleClick() { if (fileInputRef.current) { fileInputRef.current.click(); } } return ( <> onChange(ev.target.files)} />
handleClick()}>{children}
); } export default UploadWrapper;