'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useEffect, useState } from 'react'; import { ClipboardList, Droplets, Users } from 'lucide-react'; const TABS = [ { href: '/clock', label: 'Employees', Icon: Users }, { href: '/clock/stock', label: 'Fuel', Icon: Droplets }, { href: '/clock/job-cards', label: 'Job cards', Icon: ClipboardList }, ]; /** Mobile-app style tab bar. Hidden on the sign-in / password screens. */ export function ClockBottomNav({ access = 'full' }: { access?: 'full' | 'clock' | 'mechanic' }) { const path = usePathname(); // Highlight the tapped tab at once: the next page takes a moment to load and an // unchanged bar reads as "the tap did not register". const [tapped, setTapped] = useState(null); useEffect(() => setTapped(null), [path]); if (path.startsWith('/clock/login') || path.startsWith('/clock/change-password')) return null; // Mechanics have no clock in/out scanner, so no Employees tab. const tabs = access === 'mechanic' ? TABS.filter(t => t.href !== '/clock') : TABS; return ; }