Create icon

This commit is contained in:
hamid zarghami
2025-12-16 12:26:27 +03:30
parent 55e8068663
commit e870b6bd59
7 changed files with 176 additions and 5 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ type Props = {
isMultiple?: boolean,
onChange?: (file: File[]) => void;
isReset?: boolean;
accept?: string;
}
const UploadBox: FC<Props> = (props: Props) => {
@@ -32,7 +33,10 @@ const UploadBox: FC<Props> = (props: Props) => {
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [files])
const { getRootProps, getInputProps } = useDropzone({ onDrop })
const { getRootProps, getInputProps } = useDropzone({
onDrop,
accept: props.accept ? { [props.accept]: [] } : undefined
})
const handleRemove = (index: number) => {
const array = [...files]