import React from 'react'; import { TrendingUp, Bell, Search, Command, Menu } from 'lucide-react'; import { useCRM } from '../context/CRMContext'; import { useLocation } from 'react-router-dom'; import clsx from 'clsx'; interface HeaderProps { onMenuClick?: () => void; } const Header: React.FC = ({ onMenuClick }) => { const { exchangeRate, orders } = useCRM(); const location = useLocation(); // Mapping English paths to proper titles if needed, or keeping English for 'Premium' feel const getTitle = () => { const path = location.pathname.substring(1); if (!path) return 'Dashboard'; const titles: Record = { 'sales': 'Vendas', 'sourcing': 'Sourcing', // or Arbitragem 'products': 'Produtos', 'orders': 'Pedidos', 'financial': 'Financeiro', 'customers': 'Clientes', 'inventory': 'Estoque', 'suppliers': 'Fornecedores', 'reports': 'Relatórios', 'users': 'Usuários', 'settings': 'Configurações' }; return titles[path] || path.charAt(0).toUpperCase() + path.slice(1); }; const totalProfit = orders .filter(o => o.status === 'Received') .reduce((acc, o) => acc + o.estimatedProfit, 0); return (
{/* Left: Breadcrumb/Title */}
App / {getTitle()}

{getTitle()}

{/* Right: Actions */}
{/* Search Bar (Visual Only) */}
Buscar...
K
{/* Stats */}
Dólar Hoje R$ {exchangeRate.toFixed(2)}
Lucro Total 0 ? "text-emerald-400 bg-emerald-400/10" : "text-foreground" )}> R$ {totalProfit.toLocaleString('pt-BR')}
); }; export default Header;