import { useState } from "react"; import { createStyles, Navbar, Group, Code, getStylesRef, rem } from "@mantine/core"; import { IconBellRinging, IconFingerprint, IconKey, IconSettings, Icon2fa, IconDatabaseImport, IconReceipt2, IconSwitchHorizontal, IconLogout, } from "@tabler/icons-react"; // import { MantineLogo } from '@mantine/ds'; const useStyles = createStyles((theme) => ({ header: { paddingBottom: theme.spacing.md, marginBottom: `calc(${theme.spacing.md} * 1.5)`, borderBottom: `${rem(1)} solid ${ theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2] }`, }, footer: { paddingTop: theme.spacing.md, marginTop: theme.spacing.md, borderTop: `${rem(1)} solid ${ theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2] }`, }, link: { ...theme.fn.focusStyles(), display: "flex", alignItems: "center", textDecoration: "none", fontSize: theme.fontSizes.sm, color: theme.colorScheme === "dark" ? theme.colors.dark[1] : theme.colors.gray[7], padding: `${theme.spacing.xs} ${theme.spacing.sm}`, borderRadius: theme.radius.sm, fontWeight: 500, "&:hover": { backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0], color: theme.colorScheme === "dark" ? theme.white : theme.black, [`& .${getStylesRef("icon")}`]: { color: theme.colorScheme === "dark" ? theme.white : theme.black, }, }, }, linkIcon: { ref: getStylesRef("icon"), color: theme.colorScheme === "dark" ? theme.colors.dark[2] : theme.colors.gray[6], marginRight: theme.spacing.sm, }, linkActive: { "&, &:hover": { backgroundColor: theme.fn.variant({ variant: "light", color: theme.primaryColor }).background, color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color, [`& .${getStylesRef("icon")}`]: { color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color, }, }, }, })); const data = [ { link: "", label: "Notifications", icon: IconBellRinging }, { link: "", label: "Billing", icon: IconReceipt2 }, { link: "", label: "Security", icon: IconFingerprint }, { link: "", label: "SSH Keys", icon: IconKey }, { link: "", label: "Databases", icon: IconDatabaseImport }, { link: "", label: "Authentication", icon: Icon2fa }, { link: "", label: "Other Settings", icon: IconSettings }, ]; export default function AppNav({ children }: { children: React.ReactNode }) { const { classes, cx } = useStyles(); const [active, setActive] = useState("Billing"); const links = data.map((item) => ( { event.preventDefault(); setActive(item.label); }} > {item.label} )); return ( {/* */} v3.1.2 {links} event.preventDefault()}> Change account event.preventDefault()}> Logout {children} ); }