Spaces:
Configuration error
Configuration error
Download frontend/src/components/features/images/upload-image-input.tsx from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/features/images/upload-image-input.tsx
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/components/features/images/upload-image-input.tsx
-
curl -L -o upload-image-input.tsx https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/features/images/upload-image-input.tsx
702 Bytes
| import Clip from "#/icons/clip.svg?react"; | |
| interface UploadImageInputProps { | |
| onUpload: (files: File[]) => void; | |
| label?: React.ReactNode; | |
| } | |
| export function UploadImageInput({ onUpload, label }: UploadImageInputProps) { | |
| const handleUpload = (event: React.ChangeEvent<HTMLInputElement>) => { | |
| if (event.target.files) onUpload(Array.from(event.target.files)); | |
| }; | |
| return ( | |
| <label className="cursor-pointer py-[10px]"> | |
| {label || <Clip data-testid="default-label" width={24} height={24} />} | |
| <input | |
| data-testid="upload-image-input" | |
| type="file" | |
| accept="image/*" | |
| multiple | |
| hidden | |
| onChange={handleUpload} | |
| /> | |
| </label> | |
| ); | |
| } | |