"use client"; import * as React from "react"; import Image from "next/image"; import { IconChartBar, IconDashboard, IconDatabase, IconFileDescription, IconHelp, IconListDetails, IconReport, IconSettings, IconUsers, IconStethoscope, IconCalendar, IconMedicalCross, IconUserCog, } from "@tabler/icons-react"; import { NavDocuments } from "@/components/layout/nav-documents"; import { NavMain } from "@/components/layout/nav-main"; import { NavSecondary } from "@/components/layout/nav-secondary"; import { NavUser } from "@/components/layout/nav-user"; import Link from "next/link"; import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from "@/components/ui/sidebar"; const adminData = { navMain: [ { title: "Dashboard", url: "/admin", icon: IconDashboard, }, { title: "Appointments", url: "/admin/appointment-management", icon: IconCalendar, }, { title: "Patients", url: "/admin/patient-management", icon: IconUsers, }, { title: "Dentists", url: "/admin/dentist-management", icon: IconStethoscope, }, { title: "Services", url: "/admin/service-management", icon: IconMedicalCross, }, { title: "Users", url: "/admin/user-management", icon: IconUserCog, }, ], navSecondary: [ { title: "Settings", url: "/admin/settings", icon: IconSettings, }, { title: "Help & Support", url: "/admin/help-support", icon: IconHelp, }, ], documents: [ { name: "Analytics", url: "/Dashboard", icon: IconChartBar, }, { name: "Reports", url: "/Reports", icon: IconReport, }, ], }; const patientData = { navMain: [ { title: "Dashboard", url: "/patient", icon: IconDashboard, }, { title: "Book Appointment", url: "/patient/book-appointment", icon: IconCalendar, }, { title: "My Appointments", url: "/patient/appointments", icon: IconListDetails, }, { title: "Payments", url: "/patient/payments", icon: IconFileDescription, }, { title: "Health Records", url: "/patient/health-records", icon: IconDatabase, }, ], navSecondary: [ { title: "Settings", url: "/patient/settings", icon: IconSettings, }, { title: "Help & Support", url: "#", icon: IconHelp, }, ], documents: [], }; const dentistData = { navMain: [ { title: "Dashboard", url: "/dentist", icon: IconDashboard, }, { title: "My Appointments", url: "/dentist/appointments", icon: IconCalendar, }, { title: "My Patients", url: "/dentist/patients", icon: IconUsers, }, { title: "Schedule", url: "/dentist/schedule", icon: IconListDetails, }, ], navSecondary: [ { title: "Settings", url: "/dentist/settings", icon: IconSettings, }, { title: "Help & Support", url: "#", icon: IconHelp, }, ], documents: [], }; type AppSidebarProps = React.ComponentProps & { user?: { id: string; name: string; email: string; image?: string | null; role?: string | null; } | null; isAdmin?: boolean; }; export function AppSidebar({ user, isAdmin, ...props }: AppSidebarProps) { // Determine which data to use based on user role const role = user?.role || "patient"; const data = role === "admin" ? adminData : role === "dentist" ? dentistData : patientData; const homeUrl = role === "admin" ? "/admin" : role === "dentist" ? "/dentist" : "/"; return ( <> Dental U Care Dental U-Care {data.documents.length > 0 && } {user && } ); }