2024-06-20 17:02:11 +02:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
import Link from "next/link";
|
|
|
|
import { usePathname } from "next/navigation";
|
|
|
|
import { AdminLinks } from "@/constants";
|
2024-07-20 21:04:38 +02:00
|
|
|
import Logo from "@/components/shared/Logo";
|
2024-06-20 17:02:11 +02:00
|
|
|
|
|
|
|
const Sidebar = () => {
|
2024-07-17 20:33:43 +02:00
|
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<aside className="sidebar">
|
|
|
|
<div className="flex size-full flex-col gap-4">
|
|
|
|
<Link href="/" className="sidebar-logo">
|
2024-07-28 16:47:09 +02:00
|
|
|
<Logo width={155} height={53} />
|
2024-07-17 20:33:43 +02:00
|
|
|
</Link>
|
2024-06-20 17:02:11 +02:00
|
|
|
|
2024-07-17 20:33:43 +02:00
|
|
|
<nav className="sidebar-nav">
|
|
|
|
<ul className="sidebar-nav_elements">
|
2024-08-01 16:32:57 +02:00
|
|
|
{AdminLinks.slice(0, 6).map((link) => {
|
2024-07-17 20:33:43 +02:00
|
|
|
const isActive = link.url === pathname;
|
2024-06-20 17:02:11 +02:00
|
|
|
|
2024-07-17 20:33:43 +02:00
|
|
|
return (
|
|
|
|
<li
|
|
|
|
key={link.url}
|
|
|
|
className={`sidebar-nav_element group ${
|
|
|
|
isActive ? "bg-white/5" : "text-muted-foreground"
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
<Link className="sidebar-link" href={link.url}>
|
|
|
|
<link.icon />
|
|
|
|
{link.name}
|
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</ul>
|
2024-06-20 17:02:11 +02:00
|
|
|
|
2024-07-17 20:33:43 +02:00
|
|
|
<ul className="sidebar-nav_elements">
|
2024-08-01 16:32:57 +02:00
|
|
|
{AdminLinks.slice(6).map((link) => {
|
2024-07-17 20:33:43 +02:00
|
|
|
const isActive = link.url === pathname;
|
2024-06-20 17:02:11 +02:00
|
|
|
|
2024-07-17 20:33:43 +02:00
|
|
|
return (
|
|
|
|
<li
|
|
|
|
key={link.url}
|
|
|
|
className={`sidebar-nav_element group ${
|
|
|
|
isActive ? "bg-purple-gradient" : "text-muted-foreground"
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
<Link className="sidebar-link" href={link.url}>
|
|
|
|
<link.icon />
|
|
|
|
{link.name}
|
|
|
|
</Link>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
</aside>
|
|
|
|
</>
|
|
|
|
);
|
2024-06-20 17:02:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Sidebar;
|