2025-09-03 17:22:24 -07:00
|
|
|
import { Flex, Tabs, HStack } from '@chakra-ui/react';
|
2026-06-10 14:00:37 -07:00
|
|
|
import { MEDataEntry } from './tabs/MEDataEntry.jsx';
|
|
|
|
|
import { ProjectCollector } from './tabs/ProjectCollector.jsx';
|
|
|
|
|
import { NASApplication } from './tabs/NASApplication.jsx';
|
|
|
|
|
import { IVANS } from './tabs/IVANS.jsx'
|
|
|
|
|
import { SearchBar } from "../../components/dashboard/SearchBar.jsx";
|
|
|
|
|
import { SettingsButton } from "../../components/dashboard/SettingsButton.jsx";
|
|
|
|
|
import { CanvasHeaderTabs } from '../../components/dashboard/CanvasHeaderTabs.jsx';
|
|
|
|
|
import { ADMIN_TABS } from '@/constants/viewKeys.js';
|
2025-07-23 12:03:06 -07:00
|
|
|
|
2025-09-05 20:15:00 +00:00
|
|
|
// TODO - refactor this. Currently Admin doesn't use onEditWidgets or appendWidget
|
2025-08-13 15:18:03 -07:00
|
|
|
export default function Admin({ view, onChangeView, onEditWidgets, appendWidget }) {
|
|
|
|
|
const settingsButtonProps = { onEditWidgets, appendWidget };
|
|
|
|
|
|
2025-07-24 08:52:20 -07:00
|
|
|
return (
|
2025-08-13 15:18:03 -07:00
|
|
|
/* HEADER */
|
|
|
|
|
<Tabs.Root
|
|
|
|
|
width="100%"
|
|
|
|
|
height="100%"
|
|
|
|
|
lazyMount
|
|
|
|
|
value={ view }
|
|
|
|
|
variant="line"
|
|
|
|
|
// Prevent navigation away from 'My Dashboard' while in Edit mode
|
|
|
|
|
onValueChange={(e) => {
|
|
|
|
|
const nextView = e.value;
|
|
|
|
|
onChangeView(nextView);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Flex
|
|
|
|
|
as="header"
|
|
|
|
|
position="sticky"
|
|
|
|
|
top="0"
|
2026-01-30 19:11:11 +00:00
|
|
|
zIndex="dropdown" // zIndex: 1100
|
2025-08-13 15:18:03 -07:00
|
|
|
bg="base200"
|
2025-09-05 20:15:00 +00:00
|
|
|
pl={5}
|
|
|
|
|
pr={2}
|
2025-08-13 15:18:03 -07:00
|
|
|
pt={3}
|
|
|
|
|
pb={2}
|
|
|
|
|
align="center"
|
|
|
|
|
justify="space-between"
|
|
|
|
|
width="100%"
|
2025-07-24 08:52:20 -07:00
|
|
|
>
|
2025-09-05 20:15:00 +00:00
|
|
|
{/* HEADER */}
|
|
|
|
|
<CanvasHeaderTabs tabs={ADMIN_TABS} />
|
2026-01-30 19:11:11 +00:00
|
|
|
<HStack width="258px" justifyContent="flex-end">
|
2025-09-05 20:15:00 +00:00
|
|
|
<SearchBar />
|
|
|
|
|
<SettingsButton />
|
2026-01-30 19:11:11 +00:00
|
|
|
</HStack>
|
2025-08-13 15:18:03 -07:00
|
|
|
</Flex>
|
|
|
|
|
|
|
|
|
|
{/* CANVAS */}
|
|
|
|
|
<Tabs.Content value="medataentry">
|
2026-01-30 19:11:11 +00:00
|
|
|
<MEDataEntry />
|
|
|
|
|
</Tabs.Content>
|
|
|
|
|
<Tabs.Content value="projectcollector">
|
|
|
|
|
<ProjectCollector />
|
|
|
|
|
</Tabs.Content>
|
|
|
|
|
<Tabs.Content value="nasapplication">
|
|
|
|
|
<NASApplication />
|
|
|
|
|
</Tabs.Content>
|
|
|
|
|
<Tabs.Content value="ivans">
|
|
|
|
|
<IVANS />
|
|
|
|
|
</Tabs.Content>
|
2025-08-13 15:18:03 -07:00
|
|
|
</Tabs.Root>
|
2025-07-24 08:52:20 -07:00
|
|
|
);
|
2025-08-13 15:35:17 -07:00
|
|
|
}
|