MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / FileUploadButton

Function FileUploadButton

apps/web/ui/FileUploadButton/index.tsx:15–41  ·  view source on GitHub ↗
({
  id,
  disabled,
  onChange,
  uploading,
  progress,
  accept,
}: Props)

Source from the content-addressed store, hash-verified

13}
14
15export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected