diff --git a/src/client/src/pages/detail/attachments/fileDropzone.jsx b/src/client/src/pages/detail/attachments/fileDropzone.jsx index b49fdee43..8b19a279d 100644 --- a/src/client/src/pages/detail/attachments/fileDropzone.jsx +++ b/src/client/src/pages/detail/attachments/fileDropzone.jsx @@ -115,7 +115,7 @@ export const FileDropzone = props => { const removeFile = fileToRemove => { setFiles(prevFiles => prevFiles.filter(file => file !== fileToRemove)); if (setFileType) { - setFileType(null); + setFileType(""); } }; diff --git a/src/client/src/pages/overview/sidePanelContent/commons/actionsInterfaces.ts b/src/client/src/pages/overview/sidePanelContent/commons/actionsInterfaces.ts index 98d55d4c8..4a6850954 100644 --- a/src/client/src/pages/overview/sidePanelContent/commons/actionsInterfaces.ts +++ b/src/client/src/pages/overview/sidePanelContent/commons/actionsInterfaces.ts @@ -20,11 +20,7 @@ export interface NewBoreholeProps extends WorkgroupSelectProps { toggleDrawer: (open: boolean) => void; } -export interface ImportContentProps { - setSelectedFile: React.Dispatch>; -} - -export interface ImportModalProps extends ImportContentProps { +export interface ImportModalProps { modal: boolean; creating: boolean; selectedFile: Blob[] | null; diff --git a/src/client/src/pages/overview/sidePanelContent/importer/importModal.tsx b/src/client/src/pages/overview/sidePanelContent/importer/importModal.tsx index 46313d403..afb577476 100644 --- a/src/client/src/pages/overview/sidePanelContent/importer/importModal.tsx +++ b/src/client/src/pages/overview/sidePanelContent/importer/importModal.tsx @@ -26,7 +26,7 @@ const ImportModal = ({ }: ImportModalProps) => { const { showAlert } = useContext(AlertContext); const { t } = useTranslation(); - const [fileType, setFileType] = useState(null); // Track file type + const [fileType, setFileType] = useState(""); // Track file type const handleImportResponse = async (response: Response) => { setCreating(false); diff --git a/src/client/src/pages/overview/sidePanelContent/importer/importModalContent.tsx b/src/client/src/pages/overview/sidePanelContent/importer/importModalContent.tsx index a0a1b5f86..e7185ae15 100644 --- a/src/client/src/pages/overview/sidePanelContent/importer/importModalContent.tsx +++ b/src/client/src/pages/overview/sidePanelContent/importer/importModalContent.tsx @@ -1,4 +1,4 @@ -import { useCallback } from "react"; +import React, { useCallback } from "react"; import { useTranslation } from "react-i18next"; import { Box, Stack } from "@mui/material/"; import { downloadCodelistCsv } from "../../../../api/fetchApiV2.js"; @@ -6,8 +6,12 @@ import { StackHalfWidth } from "../../../../components/styledComponents.ts"; import { capitalizeFirstLetter } from "../../../../utils.ts"; import Downloadlink from "../../../detail/attachments/downloadlink.jsx"; import { FileDropzone } from "../../../detail/attachments/fileDropzone.jsx"; -import { ImportContentProps } from "../commons/actionsInterfaces.js"; +interface ImportModalContentProps { + setSelectedFile: React.Dispatch>; + setFileType: (type: string) => void; + fileType: string; +} const ExampleHeadings = (headings: string) => { return ( { ); }; -const ImportModalContent = ({ - setSelectedFile, - setFileType, - fileType, -}: ImportContentProps & { setFileType: (type: string) => void } & { fileType: string | null }) => { +const ImportModalContent = ({ setSelectedFile, setFileType, fileType }: ImportModalContentProps) => { const { t } = useTranslation(); const handleCsvFileChange = useCallback(