"use client"; import { ReactNode, useState } from "react"; import { DropzoneOptions, FileWithPath, useDropzone } from "react-dropzone"; import { Icon } from "@iconify/react"; interface Props { onDrop: (acceptedFiles: FileWithPath[]) => void; options?: DropzoneOptions; children?: ReactNode; } export default function Dropzone({ onDrop, options, children }: Props) { const [isDraggingOver, setIsDraggingOver] = useState(false); const handleDrop = (acceptedFiles: FileWithPath[]) => { setIsDraggingOver(false); onDrop(acceptedFiles); }; const { getRootProps, getInputProps } = useDropzone({ onDrop: handleDrop, maxFiles: 3, accept: { "image/*": [".png", ".jpg", ".jpeg", ".bmp", ".webp", ".heic"], }, ...options, }); return (