const TABS = [
{ label: 'Dashboard', href: '/', icon: 'layout-dashboard' },
{ label: 'Work Orders', href: '/work-orders', icon: 'clipboard-list' },
{ label: 'People', href: '/registry/people', icon: 'users' },
{ label: 'Reports', href: '/reports', icon: 'bar-chart-2' },
];
class AppMobileNav extends HTMLElement {
connectedCallback() {
this.#render();
window.addEventListener('hashchange', () => this.#render());
}
#render() {
const path = decodeURIComponent(location.hash.slice(1)) || '/';
this.innerHTML = `
${TABS.map(t => {
const active = t.href === '/' ? path === '/' : path.startsWith(t.href);
return `
${t.label}
`;
}).join('')}`;
if (window.lucide) lucide.createIcons({ root: this });
}
}
customElements.define('app-mobile-nav', AppMobileNav);