diff --git a/client/src/Features/UI/uiSlice.ts b/client/src/Features/UI/uiSlice.ts index 143d170db..55e83333c 100644 --- a/client/src/Features/UI/uiSlice.ts +++ b/client/src/Features/UI/uiSlice.ts @@ -1,11 +1,9 @@ +import { dashboardCardKeys, type DashboardCardKey } from "@/Types/Dashboard"; import { createSlice, type PayloadAction } from "@reduxjs/toolkit"; type ThemeMode = "light" | "dark"; type ChartType = "histogram" | "line"; -export const dashboardCardKeys = ["monitorStatus", "monitorsByType"] as const; -export type DashboardCardKey = (typeof dashboardCardKeys)[number]; - type TableName = | "monitors" | "team" diff --git a/client/src/Pages/Dashboard/components/EditCardsModal.tsx b/client/src/Pages/Dashboard/components/EditCardsModal.tsx index 48731eb9b..84257c1ec 100644 --- a/client/src/Pages/Dashboard/components/EditCardsModal.tsx +++ b/client/src/Pages/Dashboard/components/EditCardsModal.tsx @@ -3,9 +3,7 @@ import Stack from "@mui/material/Stack"; import FormControlLabel from "@mui/material/FormControlLabel"; import { useTranslation } from "react-i18next"; import { Checkbox, Dialog } from "@/Components/inputs"; -import { type DashboardCardKey, dashboardCardKeys } from "@/Features/UI/uiSlice"; - -export type { DashboardCardKey }; +import { type DashboardCardKey, dashboardCardKeys } from "@/Types/Dashboard"; interface EditCardsModalProps { open: boolean; @@ -52,7 +50,7 @@ export const EditCardsModal = ({ fullWidth > - {dashboardCardKeys.map((key) => ( + {dashboardCardKeys.map((key: DashboardCardKey) => ( { const theme = useTheme(); @@ -78,7 +75,7 @@ const Dashboard = () => { {dashboardCardKeys .filter((key) => visibleCards.has(key)) .map((key) => ( -
{cardComponents[key]}
+ {cardComponents[key]} ))}
diff --git a/client/src/Types/Dashboard.ts b/client/src/Types/Dashboard.ts new file mode 100644 index 000000000..a397ec807 --- /dev/null +++ b/client/src/Types/Dashboard.ts @@ -0,0 +1,2 @@ +export const dashboardCardKeys = ["monitorStatus", "monitorsByType"] as const; +export type DashboardCardKey = (typeof dashboardCardKeys)[number];