import { useLocation } from 'react-router-dom';

const Navbar = () => {
  const location = useLocation();

  const getPageTitle = () => {
    const path = location.pathname;
    if (path === '/dashboard') return 'Dashboard';
    if (path === '/products') return 'Products';
    if (path === '/sales') return 'Sales';
    if (path === '/customers') return 'Customers';
    return 'POS System';
  };

  return (
    <nav className="h-14 bg-white shadow px-6 flex items-center">
      <h2 className="text-lg font-semibold text-gray-800">{getPageTitle()}</h2>
    </nav>
  );
};

export default Navbar;
