import React, { useState, useEffect } from 'react'; import { LayoutDashboard, MapPin, Users, TrendingUp, DollarSign, Wallet, Box, Grid, Receipt, BarChart2 } from 'lucide-react'; const navItems = [ { icon: LayoutDashboard, label: 'Dashboard', path: '/owner/dashboard' }, { icon: MapPin, label: 'Branches', path: '/owner/branches' }, { icon: Users, label: 'Staff', path: '/owner/staff' }, { icon: TrendingUp, label: 'Investors', path: '/owner/investors' }, { icon: DollarSign, label: 'Collections', path: '/owner/collections' }, // Changed label and added path { icon: Box, label: 'Inventory', path: '/owner/inventory' }, // Added path { icon: Grid, label: 'Masters', path: '/owner/masters' }, // Updated icon and label { icon: Wallet, label: 'Accounts', path: '/owner/accounts' }, // Moved and updated {icon: Receipt, label: 'Expenses', path: '/owner/expenses' }, // New item { icon: DollarSign, label: 'POS / Billing', path: '/owner/pos' }, // Added POS { icon: BarChart2, label: 'Reports', path: '/owner/reports' }, // Added path ]; const receptionistNavItems = [ { icon: LayoutDashboard, label: 'Dashboard', path: '/receptionist/dashboard' }, { icon: DollarSign, label: 'POS / Billing', path: '/receptionist/pos' }, { icon: Wallet, label: 'Collections', path: '/receptionist/collections' }, { icon: Receipt, label: 'Expenses', path: '/receptionist/expenses' }, { icon: Box, label: 'Inventory', path: '/receptionist/inventory' }, { icon: Users, label: 'Staff Info', path: '/receptionist/staff' }, { icon: BarChart2, label: 'Reports', path: '/receptionist/reports' }, ]; export default function SubHeader({ role: propRole }) { const currentPath = window.location.pathname; const role = propRole?.toLowerCase(); if (!role) return null; const items = role === 'receptionist' ? receptionistNavItems : (role === 'owner' ? navItems : []); return (