+
+ {getStatusDecoration(status)}
+
+
+
+
+ {file.name}
+
+
+ {errorMessage === ""
+ ? getDescription({ totalSize: file.size, currentSize })
+ : errorMessage}
+
+
+
+ {status === "failedConnection" && (
+
+
+
+ )}
+ {status === "paused" && (
+
+
+
+ )}
+ {status === "uploading" && (
+
+
+
+ )}
+ {status !== "uploading" && (
+
+
+
+ )}
+
+ );
+};
+
+export const FileUploadExample = () => {
+ const [files, setFiles] = useState<{ file: File; badConnection?: boolean }[]>(
+ [],
+ );
+
+ const handleFiles = (_: SyntheticEvent, files: File[]) => {
+ setFiles((old) =>
+ old.concat(
+ files.map((file) => ({
+ file,
+ })),
+ ),
+ );
+ };
+
+ const handleDelete = (fileToRemove: File) => {
+ setFiles((old) => old.filter((file) => file.file !== fileToRemove));
+ };
+
+ return (
+