import React from "react"; import classnames from "classnames"; import Button from "components/buttons/Button"; import Card from "components/Card"; import { GraphicNames } from "components/graphics"; import Graphic from "components/Graphic"; const baseClass = "file-uploader"; interface IFileUploaderProps { graphicName: GraphicNames; message: string; additionalInfo?: string; isLoading?: boolean; /** A comma seperated string of one or more file types accepted to upload. * This is the same as the html accept attribute. * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept */ accept?: string; className?: string; onFileUpload: (files: FileList | null) => void; } const FileUploader = ({ graphicName, message, additionalInfo, isLoading = false, accept, className, onFileUpload, }: IFileUploaderProps) => { const classes = classnames(baseClass, className); return (

{message}

{additionalInfo}

{ onFileUpload(e.target.files); e.target.value = ""; }} />
); }; export default FileUploader;