import { AppShell as MantineAppShell, NavLink, Text } from "@mantine/core"; import type { FC, ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { Outlet, NavLink as RouterNavLink, useLocation } from "react-router"; import { bindIconAnimation } from "@/shared/lib"; import classes from "./AppShell.module.css"; type AppShellProps = { contentAboveOutlet?: ReactNode; }; const AppShell: FC = (props) => { const { contentAboveOutlet } = props; const { t } = useTranslation(); const { pathname } = useLocation(); const items = [ { to: "/accounts", label: t("navigation.accounts"), iconClassName: classes.portfolioIcon, icon: ( <> ), }, { to: "/cards", label: t("navigation.cards"), iconClassName: classes.cardsIcon, icon: ( <> ), }, { to: "/stocks", label: t("navigation.stocks"), iconClassName: classes.stocksIcon, icon: ( <> ), }, { to: "/bonds", label: t("navigation.bonds"), iconClassName: classes.bondsIcon, icon: ( <> ), }, { to: "/settings", label: t("navigation.settings"), iconClassName: classes.settingsIcon, icon: ( <> ), }, ]; return ( {t("appName")} {items.map((item) => ( } active={pathname.startsWith(item.to)} /> ))}
{contentAboveOutlet}
); }; export { AppShell };