// File: frontend/app/_components/SideNavigation.jsx 'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Home, FileText, Users, Settings, Package2, Upload, PlusCircle, Workflow, BarChart } from 'lucide-react'; import { can } from "@/lib/rbac"; import { cn } from "@/lib/utils"; // Component นี้จะรับ user object ที่มี roles และ permissions มาจาก Server Component Parent export function SideNavigation({ user }) { const pathname = usePathname(); // สร้าง Array ของเมนูหลักตามโครงสร้างเดิมของคุณ const mainNavLinks = [ { href: '/dashboard', label: 'Dashboard', icon: Home, perm: null }, // หน้าแรกเข้าได้ทุกคน { href: '/correspondences', label: 'Correspondences', icon: FileText, perm: 'correspondence:view' }, { href: '/drawings', label: 'Drawings', icon: FileText, perm: 'drawing:view' }, { href: '/rfas', label: 'RFAs', icon: FileText, perm: 'rfa:view' }, { href: '/transmittals', label: 'Transmittals', icon: FileText, perm: 'transmittal:view' }, { href: '/reports', label: 'Reports', icon: BarChart, perm: 'report:view' }, ]; // สร้าง Array ของเมนู Admin ตามโครงสร้างเดิมของคุณ const adminNavLinks = [ { href: '/admin', label: 'Admin', icon: Settings, perm: 'admin:view' }, { href: '/users', label: 'ผู้ใช้/บทบาท', icon: Users, perm: 'users:manage' }, { href: '/workflow', label: 'Workflow', icon: Workflow, perm: 'workflow:view' }, ]; return (
LCB P3 DMS
{/* ส่วน Card ด้านล่างสามารถคงไว้ หรือเอาออกได้ตามต้องการ */}
); }