import {
  Binary,
  Network,
  Globe,
  Calculator,
  Layers,
  GraduationCap,
  ListOrdered,
  BookOpen,
  Info,
  Settings,
  LayoutDashboard,
  Star,
  type LucideIcon,
} from "lucide-react";

export type Tool = {
  slug: string;
  path: string;
  name: string;
  description: string;
  icon: LucideIcon;
  category: "Calculators" | "Utilities" | "Learn" | "App";
  keywords: string[];
};

export const TOOLS: Tool[] = [
  {
    slug: "dashboard",
    path: "/dashboard",
    name: "Dashboard",
    description: "Your networking workspace overview",
    icon: LayoutDashboard,
    category: "App",
    keywords: ["home", "overview", "start"],
  },
  {
    slug: "ipv4",
    path: "/ipv4",
    name: "IPv4 Calculator",
    description: "Subnet, broadcast, host range, binary and hex breakdown",
    icon: Network,
    category: "Calculators",
    keywords: ["subnet", "mask", "broadcast", "host", "ip"],
  },
  {
    slug: "ipv6",
    path: "/ipv6",
    name: "IPv6 Calculator",
    description: "Expand, compress and analyse IPv6 prefixes",
    icon: Globe,
    category: "Calculators",
    keywords: ["v6", "prefix", "interface id", "expand"],
  },
  {
    slug: "cidr",
    path: "/cidr",
    name: "CIDR Calculator",
    description: "Convert between CIDR prefixes and subnet masks",
    icon: Calculator,
    category: "Calculators",
    keywords: ["mask", "prefix", "slash", "convert"],
  },
  {
    slug: "vlsm",
    path: "/vlsm",
    name: "VLSM Calculator",
    description: "Plan variable length subnets from host requirements",
    icon: Layers,
    category: "Calculators",
    keywords: ["subnetting", "allocation", "design", "plan"],
  },
  {
    slug: "binary",
    path: "/binary",
    name: "Binary Converter",
    description: "Decimal, binary, hexadecimal and dotted-quad conversion",
    icon: Binary,
    category: "Utilities",
    keywords: ["hex", "decimal", "base", "convert"],
  },
  {
    slug: "ip-range",
    path: "/ip-range",
    name: "IP Range Generator",
    description: "List every usable host address inside a subnet",
    icon: ListOrdered,
    category: "Utilities",
    keywords: ["hosts", "export", "list", "enumerate"],
  },
  {
    slug: "practice",
    path: "/practice",
    name: "Subnetting Practice",
    description: "Timed quiz with instant feedback and score tracking",
    icon: GraduationCap,
    category: "Learn",
    keywords: ["quiz", "exam", "ccna", "training"],
  },
  {
    slug: "cheatsheet",
    path: "/cheatsheet",
    name: "Cheat Sheet",
    description: "Ports, RFC ranges, OSI model and CIDR reference",
    icon: BookOpen,
    category: "Learn",
    keywords: ["ports", "osi", "tcp", "udp", "reference", "docs"],
  },
  {
    slug: "favorites",
    path: "/favorites",
    name: "Favorites",
    description: "Your starred tools",
    icon: Star,
    category: "App",
    keywords: ["starred", "pinned"],
  },
  {
    slug: "settings",
    path: "/settings",
    name: "Settings",
    description: "Theme, defaults and stored data",
    icon: Settings,
    category: "App",
    keywords: ["theme", "preferences", "reset"],
  },
  {
    slug: "about",
    path: "/about",
    name: "About",
    description: "Project information, version and credits",
    icon: Info,
    category: "App",
    keywords: ["credits", "version", "info"],
  },
];

export const TOOL_MAP: Record<string, Tool> = Object.fromEntries(TOOLS.map((t) => [t.slug, t]));

export const CATEGORY_ORDER: Tool["category"][] = ["App", "Calculators", "Utilities", "Learn"];

export const APP_VERSION = "1.0.0";
