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

66 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-03-24 14:35:23 +05:30
import { Link, useLocation } from "react-router-dom";
2026-03-16 17:55:33 +05:30
2026-03-24 14:35:23 +05:30
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",
},
{
2026-03-17 13:11:00 +05:30
name: "Doctor",
path: "/doctor",
2026-03-16 17:55:33 +05:30
},
2026-03-19 13:12:04 +05:30
{
name: "Appointments",
path: "/appointment",
},
2026-03-24 14:35:23 +05:30
{
name: "Career",
path: "/career",
},
2026-03-25 10:10:15 +05:30
{
name: "Candidates",
path: "/candidate",
},
2026-03-19 16:41:46 +05:30
{
name: "Email",
path: "/email",
},
2026-03-16 17:55:33 +05:30
{
2026-03-17 16:22:37 +05:30
name: "Blog",
path: "/blog",
2026-03-16 17:55:33 +05:30
},
];
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"}
2026-03-25 10:10:15 +05:30
className="w-full justify-start">
2026-03-16 17:55:33 +05:30
{item.name}
</Button>
</Link>
);
})}
</nav>
2026-03-12 17:56:52 +05:30
</div>
);
}