import { default as React } from 'react'; import { Accept, DropzoneRootProps } from 'react-dropzone'; import { FormError } from '../../../types'; import { IconType } from '../../icon'; import { FileUploadContent, FileUploadDropZoneState } from '../types'; /** * Props for the DropZone component. * @interface IDropZoneProps */ export default interface IDropZoneProps extends Omit, FormError { /** * The maximum size of a file that can be uploaded in bytes. * @default Infinity */ maxSize: number; /** * If true, the Dropzone is currently active (dragging over the component). * @default false */ isDragActive: boolean; /** * Icon shown above the texts. Ignored when `renderContent` is set. * @default 'Upload' */ icon?: IconType; /** * Texts of the default content. Ignored when `renderContent` is set. */ content?: FileUploadContent; /** * Replaces the icon and the texts with custom content. The default layout (flex, gap, padding) is not applied. */ renderContent?: (state: FileUploadDropZoneState) => React.ReactNode; /** * Accepted file types, forwarded to the `hint` function and `renderContent`. */ acceptedFileType?: string | Accept; }