mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-05 05:45:46 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
33 lines
1.3 KiB
TypeScript
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>
|
|
);
|
|
}
|