import React, { useState } from 'react'; import { LayoutGrid, ClipboardList, CheckSquare, History as HistoryIcon, Zap, BookOpen, PlusCircle, ChevronRight, ShieldCheck, Users, Calendar, HelpCircle, ExternalLink, CheckCircle, Bell } from 'lucide-react'; import { cn } from '../lib/utils'; import { motion } from 'framer-motion'; import ritLogo from '../assets/images/college-logo.png'; import { useAuth } from '../context/AuthContext'; interface SidebarProps { activeItem: string; onItemClick: (id: string) => void; } export const Sidebar: React.FC = ({ activeItem, onItemClick }) => { const { user } = useAuth(); const isClubAuthorized = user?.isClubCoordinator || user?.role === 'ADMIN'; const menuItems = [ { icon: LayoutGrid, label: 'Dashboard', id: 'dashboard' }, ...((user?.role === 'HOD' || user?.role === 'PRINCIPAL') ? [{ icon: CheckCircle, label: 'Approvals', id: 'approvals' }] : []), ...(isClubAuthorized ? [{ icon: ShieldCheck, label: 'Clubs', id: 'clubs' }] : []), { icon: ClipboardList, label: 'All Events', id: 'events' }, { icon: CheckSquare, label: 'Checklist', id: 'checklist' }, { icon: HistoryIcon, label: 'History', id: 'history' }, ...((user?.role === 'ADMIN' || user?.role === 'PRINCIPAL' || user?.role === 'HOD') ? [{ icon: Zap, label: 'Automation', id: 'automation' }] : []), ...(user?.role === 'ADMIN' ? [{ icon: BookOpen, label: 'Classes', id: 'classes' }] : []), ...(user?.role === 'ADMIN' ? [{ icon: Users, label: 'Manage Users', id: 'user-management' }] : []), ...(user?.role === 'ADMIN' ? [{ icon: Bell, label: 'Manage Notices', id: 'manage-notices' }] : []), ...((user?.role === 'FACULTY' || user?.role === 'HOD' || user?.role === 'ADMIN') ? [{ icon: Users, label: 'Student Hub', id: 'student-registrations' }] : []) ]; return ( ); };