From c3dcb9c827df6d80ad1b0b1a7c6155561527b39d Mon Sep 17 00:00:00 2001 From: l3wdfut4pwr Date: Tue, 30 Dec 2025 13:46:39 +0200 Subject: init --- src/components/upload/Dropzone.tsx | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/components/upload/Dropzone.tsx (limited to 'src/components/upload/Dropzone.tsx') diff --git a/src/components/upload/Dropzone.tsx b/src/components/upload/Dropzone.tsx new file mode 100644 index 0000000..6980f5c --- /dev/null +++ b/src/components/upload/Dropzone.tsx @@ -0,0 +1,45 @@ +'use client'; + +import Dropzone from 'react-dropzone'; +import UploadIcon from '@icons/upload.svg'; +import { Button } from '@/components/ui'; +import { useRef, useState } from 'react'; + +export function FileDropzone() { + // const [files, setFiles] = useState([]); + const hiddenInputRef = useRef(null); + return ( + { + // setFiles((prev) => [...prev, ...acceptedFiles]); + }} + > + {({ getRootProps, getInputProps }) => ( +
+ + + +
+ + + Выбери файлы на компьютере или перетащи сюда. JPG, + PNG до 20MB. + + + {hiddenInputRef.current?.files?.length ?? 0} + +
+ +
+ )} +
+ ); +} -- cgit v1.3-3-g829e