/**
 * Icon names to icon components, for the names that live in data.
 *
 * `DemoMeta.icon` and `VerticalEntry.icon` are strings, so the data stays
 * serialisable and one demo's icon does not drag lucide into every chunk. That
 * only holds if the resolver imports icons BY NAME, as below. Do not replace
 * this with `import * as lucide` and a lookup — it compiles, it renders, and it
 * quietly ships all fourteen hundred icons.
 *
 * Adding a demo or a vertical with an icon that is not in this map is not an
 * error: it falls back to `Blocks`. Add the name here when you notice.
 */

import {
  Blocks,
  Braces,
  Cpu,
  Grid3x3,
  Headset,
  ListChecks,
  Puzzle,
  RadioTower,
  Scale,
  ShieldCheck,
  Siren,
  Stethoscope,
  Table2,
  Tag,
  Truck,
  Zap,
} from 'lucide-react';
import type { LucideIcon } from 'lucide-react';

const REGISTRY: Record<string, LucideIcon> = {
  Blocks,
  Braces,
  Cpu,
  Grid3x3,
  Headset,
  ListChecks,
  Puzzle,
  RadioTower,
  Scale,
  ShieldCheck,
  Siren,
  Stethoscope,
  Table2,
  Tag,
  Truck,
  Zap,
};

export function iconFor(name: string): LucideIcon {
  return REGISTRY[name] ?? Blocks;
}
