mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
20 lines
843 B
TypeScript
20 lines
843 B
TypeScript
import NavLink from '@/router/NavLink';
|
|
import { getExtensionScreens, resolveScreenPath, type ScreenParent } from './registry';
|
|
import NavigationLabel from './NavigationLabel';
|
|
import { ScreenGate } from './screenNavigation';
|
|
|
|
export default function ResourceExtensionTabs({ parent, basePath }: { parent: ScreenParent; basePath: string }) {
|
|
return getExtensionScreens('admin', parent).map((screen) =>
|
|
screen.nav ? (
|
|
<ScreenGate key={`${screen.extensionId}:${screen.id}`} screen={screen}>
|
|
<NavLink
|
|
to={`${basePath}/${resolveScreenPath(screen.path, screen.nav.params)}`}
|
|
exact={screen.nav.exact}
|
|
>
|
|
<NavigationLabel {...screen.nav} screen={screen} />
|
|
</NavLink>
|
|
</ScreenGate>
|
|
) : null
|
|
);
|
|
}
|