Files
artcraft/frontend/editor3d/app/components/reusable/UploadModal/FileUploader.tsx
T
Brandon Thomas b31badc6d1 Editor3D - this directory is a fork of "studio gen 2" by Tanish.
We'll be using this for our image generation roadmap:

https://docs.google.com/document/d/1O9YI_iLwXkl2wAJJ23dFp3eHR-JzhlRHCBPD8psG-1E/edit

The original Studio Gen 2 is in the `frontend/studio-gen-2` directory.

The original Studio Gen 1 is in the `frontend/studio-gen-1` directory
2025-03-31 13:28:59 -04:00

28 lines
706 B
TypeScript

import { FileUploader as DragDropFilesUploader } from "react-drag-drop-files";
import { DragAndDropZone } from "./DragAndDropZone";
interface Props {
title: string;
fileTypes: string[];
file: File | null;
setFile: (file: File | null) => void;
}
export const FileUploader = ({ fileTypes, title, file, setFile }: Props) => {
return (
<div className="flex w-full flex-col gap-3">
{title}
<DragDropFilesUploader
handleChange={(file: File | null) => {
setFile(file);
}}
name="file"
types={fileTypes}
maxSize={50}
>
<DragAndDropZone file={file} fileTypes={fileTypes} />
</DragDropFilesUploader>
</div>
);
};