import {ICONS} from '@/shared/utils/icons';
import type {IconType} from '@astryxdesign/core/Icon';

export interface NavEntry {
  label: string;
  href: string;
  icon: IconType;
}

/**
 * The sidebar. Adding a future module (Customers, Campaigns, Inventory,
 * Reports, Billing) is a one-line push here plus a route folder — nothing in
 * the shell changes. That is the whole point of keeping this a plain array.
 */
export const PRIMARY_NAV: NavEntry[] = [
  {label: 'Dashboard', href: '/dashboard', icon: ICONS.dashboard},
  {label: 'Commerce', href: '/commerce', icon: ICONS.commerce},
  {label: 'Store', href: '/stores', icon: ICONS.stores},
  {label: 'Lyts', href: '/lyts', icon: ICONS.lyts},
  {label: 'Leaderboard', href: '/staff', icon: ICONS.staff},
];

/** Pinned to the bottom of the sidebar via SideNav's `footer` slot. */
export const FOOTER_NAV: NavEntry[] = [];

/**
 * `/stores` must not light up for `/staff`, and `/dashboard` must not light up
 * for every route, so this is prefix matching with an exact-match guard rather
 * than a bare startsWith.
 */
export function isNavActive(pathname: string, href: string): boolean {
  return pathname === href || pathname.startsWith(`${href}/`);
}
