feat: add admin layout with sub-navigation and routing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-18 23:04:28 +01:00
parent 6a404ddd53
commit 7a49a0b1db
5 changed files with 85 additions and 12 deletions

View File

@@ -0,0 +1,36 @@
.adminNav {
display: flex;
gap: 0;
border-bottom: 1px solid var(--border-subtle);
padding: 0 20px;
background: var(--bg-base);
}
.adminTab {
padding: 10px 16px;
border: none;
background: none;
color: var(--text-secondary);
font-family: var(--font-body);
font-size: 13px;
font-weight: 500;
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
transition: color 0.15s, border-color 0.15s;
}
.adminTab:hover {
color: var(--text-primary);
}
.adminTabActive {
color: var(--amber);
border-bottom-color: var(--amber);
}
.adminContent {
flex: 1;
overflow-y: auto;
padding: 20px;
}

View File

@@ -1,22 +1,51 @@
import { useNavigate, useLocation } from 'react-router-dom'
import { AppShell } from '../../design-system/layout/AppShell/AppShell'
import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar'
import { TopBar } from '../../design-system/layout/TopBar/TopBar'
import { EmptyState } from '../../design-system/primitives/EmptyState/EmptyState'
import { SIDEBAR_APPS } from '../../mocks/sidebar'
import styles from './Admin.module.css'
import type { ReactNode } from 'react'
const ADMIN_TABS = [
{ label: 'User Management', path: '/admin/rbac' },
{ label: 'Audit Log', path: '/admin/audit' },
{ label: 'OIDC', path: '/admin/oidc' },
]
interface AdminLayoutProps {
title: string
children: ReactNode
}
export function AdminLayout({ title, children }: AdminLayoutProps) {
const navigate = useNavigate()
const location = useLocation()
export function Admin() {
return (
<AppShell sidebar={<Sidebar apps={SIDEBAR_APPS} />}>
<TopBar
breadcrumb={[{ label: 'Admin' }]}
breadcrumb={[
{ label: 'Admin', href: '/admin' },
{ label: title },
]}
environment="PRODUCTION"
user={{ name: 'hendrik' }}
/>
<EmptyState
title="Admin Panel"
description="Admin panel coming soon."
/>
<nav className={styles.adminNav} aria-label="Admin sections">
{ADMIN_TABS.map((tab) => (
<button
key={tab.path}
className={`${styles.adminTab} ${location.pathname === tab.path ? styles.adminTabActive : ''}`}
onClick={() => navigate(tab.path)}
type="button"
>
{tab.label}
</button>
))}
</nav>
<div className={styles.adminContent}>
{children}
</div>
</AppShell>
)
}