import Stack from "@mui/material/Stack"; import { Icon, MonitorStatus } from "@/Components/design-elements"; import { Button } from "@/Components/inputs"; import { Settings, Pause, Play, Mail, Bug, Trash } from "lucide-react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { useTheme } from "@mui/material/styles"; import { usePost } from "@/Hooks/UseApi"; import type { Monitor } from "@/Types/Monitor.js"; interface BaseHeaderProps { monitor: Monitor; } const BaseHeader = ({ monitor, children }: React.PropsWithChildren) => { const theme = useTheme(); return ( {children} ); }; interface HeaderMonitorControlsProps { path: string; monitor?: Monitor | null; isAdmin: boolean; refetch: Function; } export const HeaderMonitorControls = ({ path, monitor, isAdmin, refetch, }: HeaderMonitorControlsProps) => { const { t } = useTranslation(); const theme = useTheme(); const navigate = useNavigate(); const { post, loading: isPosting, // error: postError, } = usePost(); if (!monitor) { return null; } return ( {isAdmin && ( )} {isAdmin && ( )} ); }; interface HeaderDeleteControlsProps { monitor?: Monitor | null; isAdmin: boolean; refetch: Function; onDelete?: () => void; } export const HeaderDeleteControls = ({ monitor, isAdmin, refetch, onDelete, }: HeaderDeleteControlsProps) => { const { t } = useTranslation(); const theme = useTheme(); const { post, loading: isPosting, // error: postError, } = usePost(); if (!monitor) { return null; } return ( {isAdmin && ( )} {isAdmin && ( )} ); };