import { useSystem, useSystemSettings } from "@/apis/hooks"; import { Action, Search } from "@/components"; import { Layout } from "@/constants"; import { useNavbar } from "@/contexts/Navbar"; import { useIsOnline } from "@/contexts/Online"; import { Environment, useGotoHomepage } from "@/utilities"; import { faArrowRotateLeft, faGear, faPowerOff, } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Anchor, Avatar, Badge, Burger, createStyles, Divider, Group, Header, MediaQuery, Menu, } from "@mantine/core"; import { FunctionComponent } from "react"; const useStyles = createStyles((theme) => { const headerBackgroundColor = theme.colorScheme === "light" ? theme.colors.gray[0] : theme.colors.dark[4]; return { header: { backgroundColor: headerBackgroundColor, }, }; }); const AppHeader: FunctionComponent = () => { const { data: settings } = useSystemSettings(); const hasLogout = settings?.auth.type === "form"; const { show, showed } = useNavbar(); const online = useIsOnline(); const offline = !online; const { shutdown, restart, logout } = useSystem(); const goHome = useGotoHomepage(); const { classes } = useStyles(); return (
show(!showed)} size="sm" > Bazarr } > } onClick={() => restart()} > Restart } onClick={() => shutdown()} > Shutdown
); }; export default AppHeader;