import React, { useEffect } from 'react'; import { Link, usePage } from '@inertiajs/react'; import { toast } from 'sonner'; import { LayoutDashboard, Search, Bookmark, MessageSquare, CreditCard, User, LogOut, Bell, CheckCircle, AlertCircle, ArrowRight, UserCheck, Megaphone, Briefcase, Heart } from 'lucide-react'; import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator } from '@/components/ui/dropdown-menu'; import { useTranslation, languages } from '../lib/LanguageContext'; export default function EmployerLayout({ children, title, fullPage = false }) { const { url, props } = usePage(); const { auth, unread_messages_count, flash } = props; const { locale, setLocale, t } = useTranslation(); useEffect(() => { if (flash?.success) { toast.success(flash.success); } if (flash?.error) { toast.error(flash.error); } if (flash?.first_login) { // Elegant first login celebratory alert toast.success(`🎉 ${t('welcome_title', 'Welcome to Marketplace!')}`, { description: t('welcome_desc', 'Your employer profile is verified and active with 30 days of Premium Access.'), duration: 6000, }); } }, [flash, t]); const user = auth?.user || { name: 'Guest', company_name: '', email: '', subscription_status: 'inactive', subscription_expires_at: '', }; const isSubActive = user.subscription_status === 'active'; const navItems = [ { name: 'Dashboard', translationKey: 'dashboard', href: '/employer/dashboard', icon: LayoutDashboard }, { name: 'Find Workers', translationKey: 'find_workers', href: '/employer/workers', icon: Search }, { name: 'Shortlist', translationKey: 'shortlist', href: '/employer/shortlist', icon: Bookmark }, { name: 'Candidates', translationKey: 'candidates', href: '/employer/candidates', icon: UserCheck }, { name: 'Messages', translationKey: 'messages', href: '/employer/messages', icon: MessageSquare, badge: unread_messages_count }, { name: 'Charity Events', translationKey: 'charity_events', href: '/employer/announcements', icon: Heart }, { name: 'Subscription', translationKey: 'subscription', href: '/employer/subscription', icon: CreditCard }, { name: 'My Profile', translationKey: 'my_profile', href: '/employer/profile', icon: User }, ]; const mobileTabs = [ { name: 'Search', translationKey: 'search', href: '/employer/workers', icon: Search }, { name: 'Shortlist', translationKey: 'shortlist', href: '/employer/shortlist', icon: Bookmark }, { name: 'Candidates', translationKey: 'candidates', href: '/employer/candidates', icon: UserCheck }, { name: 'Messages', translationKey: 'messages', href: '/employer/messages', icon: MessageSquare, badge: unread_messages_count }, { name: 'Profile', translationKey: 'profile', href: '/employer/profile', icon: User }, ]; return (