Files
gg-backend/frontend/src/components/layout/Sidebar.tsx
T

51 lines
946 B
TypeScript
Raw Normal View History

2026-03-16 17:55:33 +05:30
import {Link, useLocation} from "react-router-dom";
import {Button} from "@/components/ui/button";
import {Separator} from "@/components/ui/separator";
2026-03-12 17:56:52 +05:30
export default function Sidebar() {
2026-03-16 17:55:33 +05:30
const location = useLocation();
const navItems = [
{
name: "Department",
path: "/department",
},
{
name: "Blog",
path: "/blog",
},
{
name: "Subjects",
path: "/subjects",
},
];
2026-03-12 17:56:52 +05:30
return (
2026-03-16 17:55:33 +05:30
<div className="w-64 border-r bg-card">
<div className="p-6">
<h2 className="text-xl font-bold">GG Dashboard</h2>
</div>
2026-03-12 17:56:52 +05:30
2026-03-16 17:55:33 +05:30
<Separator />
2026-03-12 17:56:52 +05:30
2026-03-16 17:55:33 +05:30
<nav className="p-4 space-y-2">
{navItems.map((item) => {
const active = location.pathname === item.path;
2026-03-12 17:56:52 +05:30
2026-03-16 17:55:33 +05:30
return (
<Link key={item.path} to={item.path}>
<Button
variant={active ? "secondary" : "ghost"}
className="w-full justify-start"
>
{item.name}
</Button>
</Link>
);
})}
</nav>
2026-03-12 17:56:52 +05:30
</div>
);
}