({
id,
disabled,
onChange,
uploading,
progress,
accept,
}: Props)
| 13 | } |
| 14 | |
| 15 | export default function FileUploadButton({ |
| 16 | id, |
| 17 | disabled, |
| 18 | onChange, |
| 19 | uploading, |
| 20 | progress, |
| 21 | accept, |
| 22 | }: Props) { |
| 23 | return ( |
| 24 | <label |
| 25 | className={classNames(styles.label, { [styles.disabled]: disabled })} |
| 26 | htmlFor={id} |
| 27 | > |
| 28 | <FiUploadCloud /> {!uploading ? 'Upload' : `Uploading... ${progress}%`} |
| 29 | <input |
| 30 | className={styles.input} |
| 31 | type="file" |
| 32 | id={id} |
| 33 | name="files" |
| 34 | onChange={onChange} |
| 35 | multiple |
| 36 | disabled={disabled} |
| 37 | accept={accept} |
| 38 | /> |
| 39 | </label> |
| 40 | ); |
| 41 | } |
nothing calls this directly
no outgoing calls
no test coverage detected