49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { LayoutGrid, Wallet, ArrowLeftRight } from 'lucide-react';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
export const revalidate = 0;
|
|
import { ThemeToggle } from '@/components/theme-toggle';
|
|
import { Button } from '@/components/ui/button';
|
|
import Link from 'next/link';
|
|
|
|
const navItems = [
|
|
{ href: '/dashboard', label: '总览 (Overview)', icon: LayoutGrid },
|
|
{ href: '/dashboard/assets', label: '资产 (Assets)', icon: Wallet },
|
|
{ href: '/dashboard/transactions', label: '流水 (Transactions)', icon: ArrowLeftRight },
|
|
];
|
|
|
|
export default function DashboardLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<div className="min-h-screen flex">
|
|
<aside className="w-64 border-r border-border bg-card p-4 flex flex-col">
|
|
<div className="flex items-center gap-2 mb-8">
|
|
<span className="text-xl font-bold">Omniledger</span>
|
|
</div>
|
|
|
|
<nav className="flex flex-col gap-2 flex-1">
|
|
{navItems.map(({ href, label, icon: Icon }) => (
|
|
<Link key={href} href={href}>
|
|
<Button
|
|
variant="ghost"
|
|
className="justify-start gap-2 w-full"
|
|
>
|
|
<Icon className="h-4 w-4" />
|
|
{label}
|
|
</Button>
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
|
|
<div className="mt-auto flex justify-end">
|
|
<ThemeToggle />
|
|
</div>
|
|
</aside>
|
|
|
|
<main className="flex-1 p-6">{children}</main>
|
|
</div>
|
|
);
|
|
} |