function NavBar({ page, setPage }) {
const [menuOpen, setMenuOpen] = React.useState(false);
const links = [
{ id: 'home', label: 'Home' },
{ id: 'order', label: 'Order Now' },
{ id: 'custom', label: 'Custom Orders' },
{ id: 'about', label: 'About' },
{ id: 'contact', label: 'Contact / FAQ' },
];
function go(id) {
setMenuOpen(false);
setPage(id);
}
function Icon({ name, size = 20, color }) {
const pascal = name.split('-').map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join('');
const node = window.lucide && window.lucide.icons[pascal];
if (!node) return null;
const el = window.lucide.createElement(node);
el.setAttribute('width', size);
el.setAttribute('height', size);
el.setAttribute('stroke', color || 'currentColor');
return ;
}
return (
go('home')}
style={{ display: 'flex', alignItems: 'center', gap: 10, cursor: 'pointer', flexShrink: 0 }}
>
Little Olive Street
{links.map((l) => (
go(l.id)}
style={{
fontFamily: 'var(--font-body)', fontWeight: 500, fontSize: 14.5, cursor: 'pointer', whiteSpace: 'nowrap',
color: page === l.id ? 'var(--accent-primary)' : 'var(--text-primary)',
}}
>
{l.label}
))}
{menuOpen && (
{links.map((l) => (
go(l.id)}
style={{
fontFamily: 'var(--font-body)', fontWeight: 500, fontSize: 16, cursor: 'pointer', padding: '10px 4px',
color: page === l.id ? 'var(--accent-primary)' : 'var(--text-primary)',
}}
>
{l.label}
))}
)}
);
}