ai-bot/app/_ui/SiderNav.tsx

36 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-01-16 10:38:01 +08:00
import Link from "next/link";
import { LinkTypeItem } from "../_lib/types";
import Logo from "./Logo";
export default function SiderNav({ linkList }: { linkList: LinkTypeItem[] }) {
return (
2025-01-16 18:30:24 +08:00
<div className="w-[220px] flex flex-col gap-y-2 fixed left-0 top-0 h-[100vh] bg-[#F9F9F9]">
2025-01-16 10:38:01 +08:00
<div>
<Logo />
</div>
<nav className="flex flex-col px-1">
{
linkList.map((item) => {
return (
item?.href ?
<Link className="cursor-pointer py-3 flex gap-x-2 items-center hover:bg-[#E0E0E0] rounded pl-3 text-[#515C6B] hover:text-[#5961F9] text-[14px]" href={item.href} key={item.id}>
{
item.icon
}
<span>{item.label}</span>
</Link> :
<div className="cursor-pointer py-3 flex gap-x-2 items-center hover:bg-[#E0E0E0] rounded pl-3 text-[#515C6B] hover:text-[#5961F9] text-[14px]" key={item.id}>
{
item.icon
}
<span>{item.label}</span>
</div>
)
})
}
</nav>
</div >
)
}