import { default as React } from 'react'; import { default as IFileUploadProps } from './IFileUploadProps'; /** * FileUpload component provides a user interface for selecting and uploading files. * Can work in both controlled and uncontrolled modes: * - Controlled mode: when fileList and onChange props are provided * - Uncontrolled mode: when fileList and onChange props are not provided (component manages its own state) * @param props {@link IFileUploadProps} - The component props * @returns FileUpload component * * @example * ```tsx * // Basic usage * function App() { * const [fileList, setFileList] = useState([]); * * const onChange = ({fileList}: {fileList: IFileWithStatus[]}) => { * setFileList(fileList); * }; * * return ( * * ); * ``` * * @example * ```tsx * // Example for onUpload function when file is uploaded * function App() { * const [fileList, setFileList] = useState([]); * * // This function will be called when each file is uploaded * // You can use this function to update the file list or perform other actions * const onUpload = (file: IFileWithStatus, setProgress: (progress: number) => void) => { * // Simulate file upload with progress updates * for (let percent = 0; percent <= 100; percent += 10) { * await new Promise(resolve => setTimeout(resolve, 100)); * setProgress(percent); * } * }; * * const onChange = ({fileList}: {fileList: IFileWithStatus[]}) => { * setFileList(fileList); * }; * * return ; * } * ``` * * @example * ```tsx * // Custom icon and texts. Omitted content fields keep their German default. * `Bis zu ${maxSizeLabel}` }} * /> * ``` * * @example * ```tsx * // Replace the icon and texts entirely. FileUpload keeps the dropzone, its keyboard handling and accessible name. * // No layout is applied to the content, so style it yourself. * ( * * {isDragActive ? 'Jetzt loslassen' : 'Logo hochladen'} * * )} * /> * ``` */ declare const FileUpload: React.FC; export default FileUpload;