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",
|
|
|
|
|
},
|
|
|
|
|
{
|
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-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"}
|
|
|
|
|
className="w-full justify-start"
|
|
|
|
|
>
|
|
|
|
|
{item.name}
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</nav>
|
2026-03-12 17:56:52 +05:30
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|