import { Ref } from "preact"; import Button, { ButtonProps } from "./Button"; import { useRef } from "preact/hooks"; interface FormFileUploadProps { name?: string; onChange: (files: FileList | null) => void; multiple?: boolean; hidden?: boolean; inputRef?: Ref; } export default function FormFileUpload({ inputRef, name, onChange, multiple, hidden }: FormFileUploadProps) { return ( ) } /** * Combination of a button with a hidden file upload field. * * @param param the change listener for the file upload and the properties for the button. */ export function FormFileUploadButton({ onChange, ...buttonProps }: Omit & Pick) { const inputRef = useRef(null); return ( <>