import { Menu, MenuButton, MenuItem, MenuList, MenuPopover, MenuTrigger, } from "@fluentui/react-components"; import { Checkmark12Regular } from "@fluentui/react-icons"; import { AuthApi } from "./../api/AuthApi"; import { useAlert } from "./../hooks/providers/AlertDialogProvider"; import { useConfirm } from "./../hooks/providers/ConfirmDialogProvider"; import { Theme, useTheme } from "./../hooks/providers/ThemeProvider"; export function MainMenu(): React.ReactElement { const alert = useAlert(); const confirm = useConfirm(); const signOut = async () => { try { if (!(await confirm("Do you really want to sign out?"))) return; await AuthApi.SignOut(); } catch (e) { console.error(e); alert("Failed to perform sign out!"); } }; return (
); } function ThemeMenuItem(p: { label: string; value: Theme }): React.ReactElement { const theme = useTheme(); return ( : undefined} onClick={() => theme.set(p.value)} > {p.label} ); }