2026-04-23 15:33:11 +03:30
|
|
|
'use client';
|
|
|
|
|
|
2026-04-29 14:02:42 +03:30
|
|
|
import Link from 'next/link';
|
|
|
|
|
import { memo } from 'react';
|
|
|
|
|
import { usePathname } from 'next/navigation';
|
2026-04-23 15:33:11 +03:30
|
|
|
import {
|
|
|
|
|
LayoutDashboard,
|
|
|
|
|
Users,
|
|
|
|
|
Calendar,
|
|
|
|
|
UserCog,
|
|
|
|
|
FlaskConical,
|
|
|
|
|
FileText,
|
2026-04-29 20:19:40 +03:30
|
|
|
CreditCard,
|
|
|
|
|
Building2
|
2026-04-23 15:33:11 +03:30
|
|
|
} from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
const menu = [
|
|
|
|
|
{ name: 'Today', path: '/today', icon: LayoutDashboard },
|
|
|
|
|
{ name: 'Patients', path: '/patients', icon: Users },
|
|
|
|
|
{ name: 'Appointments', path: '/appointments', icon: Calendar },
|
|
|
|
|
{ name: 'Staff Management', path: '/staff', icon: UserCog },
|
|
|
|
|
{ name: 'Lab Management', path: '/lab', icon: FlaskConical },
|
|
|
|
|
{ name: 'Billing', path: '/billing', icon: CreditCard },
|
|
|
|
|
{ name: 'Reports', path: '/reports', icon: FileText },
|
2026-04-29 20:19:40 +03:30
|
|
|
{ name: 'Organizations', path: '/select-organization', icon: Building2 },
|
2026-04-23 15:33:11 +03:30
|
|
|
];
|
|
|
|
|
|
2026-04-29 14:02:42 +03:30
|
|
|
function Sidebar() {
|
2026-04-23 15:33:11 +03:30
|
|
|
const pathname = usePathname();
|
|
|
|
|
|
|
|
|
|
return (
|
2026-04-29 01:22:53 +03:30
|
|
|
<aside className="w-64 bg-background-secondary/90 border-r border-border text-text-primary flex flex-col p-4">
|
|
|
|
|
<div className="mb-6 pb-4 border-b border-border">
|
|
|
|
|
<h1 className="text-xl font-semibold tracking-tight">DyoLink</h1>
|
2026-04-23 15:33:11 +03:30
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<nav className="flex flex-col gap-2">
|
|
|
|
|
{menu.map((item) => {
|
|
|
|
|
const Icon = item.icon;
|
|
|
|
|
const isActive = pathname === item.path;
|
|
|
|
|
|
|
|
|
|
return (
|
2026-04-29 14:02:42 +03:30
|
|
|
<Link
|
2026-04-23 15:33:11 +03:30
|
|
|
key={item.name}
|
2026-04-29 14:02:42 +03:30
|
|
|
href={item.path}
|
|
|
|
|
prefetch
|
2026-04-29 01:22:53 +03:30
|
|
|
className={`flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-sm)] border transition-colors ${
|
2026-04-23 15:33:11 +03:30
|
|
|
isActive
|
2026-04-29 01:22:53 +03:30
|
|
|
? 'bg-primary-soft border-primary/60 text-text-primary'
|
|
|
|
|
: 'border-border/50 text-text-secondary hover:bg-background-card/70 hover:text-text-primary hover:border-border'
|
2026-04-23 15:33:11 +03:30
|
|
|
}`}
|
|
|
|
|
>
|
2026-04-29 01:22:53 +03:30
|
|
|
<Icon className="w-[18px] h-[18px] icon-flat" />
|
|
|
|
|
<span className="text-sm">{item.name}</span>
|
2026-04-29 14:02:42 +03:30
|
|
|
</Link>
|
2026-04-23 15:33:11 +03:30
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</nav>
|
|
|
|
|
</aside>
|
|
|
|
|
);
|
2026-04-29 14:02:42 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default memo(Sidebar);
|