//File: frontend/app/_components/navigation.jsx 'use client'; // <-- 1. กำหนดให้ไฟล์นี้เป็น Client Component import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Home, FileText, Settings, Package2 } from 'lucide-react'; import { can } from "@/lib/rbac"; import { cn } from "@/lib/utils"; import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; export function Navigation({ user }) { // 2. รับข้อมูล user มาจาก props const pathname = usePathname(); // 3. ใช้งาน usePathname ได้แล้ว const navLinks = [ { href: '/dashboard', label: 'Dashboard', icon: Home }, { href: '/correspondences', label: 'Correspondences', icon: FileText }, { href: '/drawings', label: 'Drawings', icon: FileText }, // ... เพิ่มเมนูอื่นๆ ตามต้องการ ]; const adminLink = { href: '/admin/users', label: 'Admin', icon: Settings, requiredPermission: 'manage_users' }; return (
LCB P3 DMS {/* Bell Icon can be here if needed */}
Need Help? Contact support for any issues or questions.
); }