// Header.jsx 'use strict'; const { useState, useRef, useEffect } = React; const PAGE_TITLES = { dashboard:'Dashboard', os:'Ordens de Serviço', clientes:'Clientes', agenda:'Agenda', servicos:'Serviços', financeiro:'Financeiro', relatorios:'Relatórios', configuracoes:'Configurações', }; function Header({ page, onMenuToggle, notifications, onMarkRead, globalSearch, setGlobalSearch, onSearchNav }) { const [showNotifs, setShowNotifs] = useState(false); const [showSearch, setShowSearch] = useState(false); const unread = (notifications || []).filter(n => !n.read).length; const notifRef = useRef(null); useEffect(() => { const h = e => { if (notifRef.current && !notifRef.current.contains(e.target)) setShowNotifs(false); }; document.addEventListener('mousedown', h); return () => document.removeEventListener('mousedown', h); }, []); const typeIcon = { warning:'AlertCircle', info:'Bell', success:'CheckCircle', error:'XCircle' }; const typeColor = { warning:'#F59E0B', info:'#3B82F6', success:'#10B981', error:'#EF4444' }; return (
{/* Mobile hamburger */} {/* Page title */}

{PAGE_TITLES[page] || page}

{/* Search */}
setGlobalSearch(e.target.value)} placeholder="Buscar OS, cliente..." className="pl-9 pr-4 py-2 w-56 rounded-xl border border-slate-200 bg-slate-50 text-sm transition-all focus:bg-white focus:border-blue-300 focus:w-72 focus:ring-2 focus:ring-blue-100" style={{ color:'#1E293B' }} onKeyDown={e => e.key==='Enter' && onSearchNav && onSearchNav()} />
{/* Notifications */}
{showNotifs && (
Notificações {unread > 0 && ( )}
{(notifications || []).map(n => (

{n.msg}

{n.time}

{!n.read && }
))}
)}
{/* User avatar */}
AD
); } Object.assign(window, { Header });