Files
pterodactyl-panel/resources/scripts/router/layouts/AccountLayout.tsx
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

33 lines
1.3 KiB
TypeScript

import { Outlet } from '@tanstack/react-router';
import SubNavigation from '@/components/elements/SubNavigation';
import SubNavigationLayout from '@/components/elements/SubNavigationLayout';
import NavLink from '@/router/NavLink';
import { getAreaNav } from '@/router/nav';
import Slot from '@/extensions/Slot';
import NavigationLabel from '@/extensions/NavigationLabel';
import { ScreenGate } from '@/extensions/screenNavigation';
export default function AccountLayout() {
return (
<SubNavigationLayout
navigation={
<SubNavigation>
<div>
<Slot name={'account.navigation.before'} />
{getAreaNav('account').map(({ segment, label, exact = false, ...meta }) => (
<ScreenGate key={segment || '/'} screen={meta.screen}>
<NavLink to={`/account${segment ? `/${segment}` : ''}`} exact={exact}>
<NavigationLabel label={label} {...meta} />
</NavLink>
</ScreenGate>
))}
<Slot name={'account.navigation.after'} />
</div>
</SubNavigation>
}
>
<Outlet />
</SubNavigationLayout>
);
}