import { LayoutDashboard, Settings } from "lucide-react";

export type NavLink = {
  to: string;
  label: string;
  icon: typeof LayoutDashboard;
  activePaths?: string[];
};

/**
 * Slim product nav: pipeline + scoring only.
 * Overview / kanban / inbox / tracer / visa browser stay routable for
 * bookmarks but are intentionally omitted from the chrome.
 */
export const NAV_LINKS: NavLink[] = [
  {
    to: "/jobs/discovered",
    label: "Jobs",
    icon: LayoutDashboard,
    activePaths: [
      "/jobs/ready",
      "/jobs/discovered",
      "/jobs/applied",
      "/jobs/all",
    ],
  },
  { to: "/settings", label: "Settings", icon: Settings },
];

export const isNavActive = (
  pathname: string,
  to: string,
  activePaths?: string[],
) => {
  if (pathname === to) return true;
  if (!activePaths) return false;
  return activePaths.some(
    (path) => pathname === path || pathname.startsWith(`${path}/`),
  );
};
