Files
Checkmate/client/src/Pages/Logs/index.jsx
T

65 lines
1.5 KiB
React
Raw Normal View History

2025-06-23 11:07:12 +08:00
import Stack from "@mui/material/Stack";
import Breadcrumbs from "../../Components/Breadcrumbs";
import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab";
import Queue from "./Queue";
2025-06-23 12:09:30 +08:00
import LogsComponent from "./Logs";
2025-07-10 16:08:04 -07:00
import Diagnostics from "./Diagnostics";
2025-06-23 11:07:12 +08:00
import { useTheme } from "@emotion/react";
import { useTranslation } from "react-i18next";
import { useState } from "react";
const Logs = () => {
const { t } = useTranslation();
const theme = useTheme();
// Local state
2025-07-10 16:08:04 -07:00
const [value, setValue] = useState(2);
2025-06-23 11:07:12 +08:00
// Handlers
const handleChange = (event, newValue) => {
setValue(newValue);
};
const BREADCRUMBS = [{ name: t("logsPage.title"), path: "/logs" }];
2025-08-13 14:47:09 +05:30
// Height of the header (Breadcrumbs + Tabs)
const HEADER_HEIGHT = theme.spacing(25);
2025-06-23 11:07:12 +08:00
return (
2025-08-13 14:47:09 +05:30
<>
<Stack
gap={theme.spacing(20)}
sx={{
position: "sticky",
top: 0,
left: 0,
right: 0,
zIndex: 1000,
backgroundColor: theme.palette.primary.main,
paddingY: theme.spacing(2),
}}
2025-06-23 11:07:12 +08:00
>
2025-08-13 14:47:09 +05:30
<Breadcrumbs list={BREADCRUMBS} />
<Tabs
value={value}
onChange={handleChange}
>
<Tab label={t("logsPage.tabs.logs")} />
<Tab label={t("logsPage.tabs.queue")} />
<Tab label={t("logsPage.tabs.diagnostics")} />
</Tabs>
</Stack>
{/* Main content below fixed header */}
<Stack sx={{ paddingTop: HEADER_HEIGHT }}>
{value === 0 && <LogsComponent />}
{value === 1 && <Queue />}
{value === 2 && <Diagnostics />}
</Stack>
</>
2025-06-23 11:07:12 +08:00
);
};
export default Logs;