feat: enhance CSV import functionality, integrate react-query for data fetching, and refactor admin components
This commit is contained in:
@@ -3,8 +3,13 @@ import { Sheet, WholeWord } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import ImportGUI from "./ImportGUI";
|
||||
|
||||
type SubHeaderAdminProps = {
|
||||
setFiles: (files: File[]) => void;
|
||||
files?: File[];
|
||||
};
|
||||
|
||||
// Sub navigation bar for admin views: provides import + clear selection actions
|
||||
const SubHeaderAdmin: React.FC = () => {
|
||||
const SubHeaderAdmin: React.FC<SubHeaderAdminProps> = ({ setFiles, files }) => {
|
||||
const [showImport, setShowImport] = useState(false);
|
||||
|
||||
return (
|
||||
@@ -48,7 +53,13 @@ const SubHeaderAdmin: React.FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
{showImport && <ImportGUI onClose={() => setShowImport(false)} />}
|
||||
{showImport && (
|
||||
<ImportGUI
|
||||
onClose={() => setShowImport(false)}
|
||||
setFiles={setFiles}
|
||||
files={files}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user