This commit is contained in:
2026-01-27 22:25:40 +08:00
parent c2f5f504d3
commit 98f21d8aaa
44 changed files with 2 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
import { wrapBasename } from "../../modules/basename";
import { clsx } from 'clsx';
export const Nav = () => {
const currentPath = typeof window !== 'undefined' ? window.location.pathname : ''
const navItems = [
{ name: '管理员设置', path: wrapBasename('/settings/') },
{ name: '全局设置', path: wrapBasename('/settings/all/') },
];
const isActive = (path: string) => {
return currentPath === path
}
return (
<nav className="space-y-2">
{navItems.map((item) => (
<a
key={item.path}
href={item.path}
className={clsx(
"block px-4 py-2 rounded transition-colors border-l-4",
isActive(item.path)
? "bg-gray-100 text-black border-black font-medium"
: "text-gray-700 border-transparent hover:bg-gray-50 hover:border-gray-300"
)}
>
{item.name}
</a>
))}
</nav>
)
}