41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import { NavLink, Outlet } from 'react-router'
|
|
|
|
const NAV = [
|
|
{ to: '/', label: '인스타 카드', end: true },
|
|
{ to: '/history', label: '만든 카드', end: false },
|
|
{ to: '/users', label: '가입자', end: false },
|
|
]
|
|
|
|
export function AdminLayout() {
|
|
return (
|
|
<div className="flex min-h-full flex-col">
|
|
<header className="sticky top-0 z-10 border-b border-line bg-rail/95 backdrop-blur-sm">
|
|
<div className="mx-auto flex h-14 max-w-[1440px] items-center gap-6 px-4 sm:px-6">
|
|
<div className="flex items-center gap-2">
|
|
<span className="relative block size-5 rounded-full bg-orange shadow-[0_2px_0_var(--color-rust)]" aria-hidden="true" />
|
|
<span className="font-brand text-[21px] leading-none">날씨각</span>
|
|
<span className="ml-1 rounded-md bg-panel px-1.5 py-0.5 text-[11px] font-semibold text-ink-soft">관리자</span>
|
|
</div>
|
|
<nav className="flex gap-1">
|
|
{NAV.map((n) => (
|
|
<NavLink
|
|
key={n.to}
|
|
to={n.to}
|
|
end={n.end}
|
|
className={({ isActive }) =>
|
|
`rounded-lg px-3 py-1.5 text-[14px] font-semibold transition-colors duration-150 ${isActive ? 'bg-panel text-ink shadow-[0_1px_2px_#28304a14]' : 'text-ink-soft hover:bg-panel/60'}`
|
|
}
|
|
>
|
|
{n.label}
|
|
</NavLink>
|
|
))}
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
<main className="min-w-0 flex-1">
|
|
<Outlet />
|
|
</main>
|
|
</div>
|
|
)
|
|
}
|