mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
implement ApiManager ver of UploadAudio - refactor UploadAudioDialogue to use endpoint - cherrypicked MediaUploadApi from api-manager-5 - code cleanup as we tread through the files - delete old request - patched ApiManager to have a multipart fetch Co-authored-by: wil <wil@storyteller.ai>
24 lines
575 B
TypeScript
24 lines
575 B
TypeScript
import { FileUploader as DragDropFileUploader } from "react-drag-drop-files";
|
|
// Usage refer to https://github.com/KarimMokhtar/react-drag-drop-files
|
|
|
|
import { DragAndDropZone } from "./DragAndDropZone";
|
|
|
|
export const FileUploader = ({
|
|
file,
|
|
fileTypes,
|
|
handleChange,
|
|
}: {
|
|
file: File | undefined;
|
|
handleChange: (file: File) => void;
|
|
fileTypes: string[];
|
|
}) => (
|
|
<DragDropFileUploader
|
|
handleChange={handleChange}
|
|
name="file"
|
|
maxSize={50}
|
|
types={fileTypes}
|
|
>
|
|
<DragAndDropZone file={file} fileTypes={fileTypes} />
|
|
</DragDropFileUploader>
|
|
);
|