深度优化 ui

This commit is contained in:
2026-09-29 11:34:18 +08:00
parent 916a4f5ffc
commit 3faf960f35
27 changed files with 6510 additions and 2232 deletions
+14 -2
View File
@@ -1,5 +1,12 @@
"use client";
import {
LayoutDashboard,
Users,
Server,
Radio,
ScrollText,
} from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
@@ -10,18 +17,23 @@ type NavItem = {
export function AdminNav({ items }: { items: NavItem[] }) {
const pathname = usePathname();
const icons = [LayoutDashboard, Users, Server, Radio, ScrollText];
return (
<nav className="nav-list">
{items.map((item) => {
const active = pathname === item.href || pathname.startsWith(`${item.href}/`);
{items.map((item, index) => {
const Icon = icons[index];
const active =
pathname === item.href || pathname.startsWith(`${item.href}/`);
return (
<Link
key={item.href}
href={item.href}
aria-current={active ? "page" : undefined}
className={`nav-link ${active ? "is-active" : ""}`}
>
<Icon size={16} aria-hidden="true" />
<span className="nav-link__label">{item.label}</span>
</Link>
);