import {
  Pill,
  Clock,
  Cross,
  HeartPulse,
  Stethoscope,
  Zap,
  Bed,
  Utensils,
  Car,
  Scissors,
  Stamp,
  Package,
  ShoppingCart,
  Banknote,
  Fuel,
  PawPrint,
  Building2,
  Shield,
  ShoppingBag,
  Wrench,
  Key,
  type LucideIcon,
} from "lucide-react";
import type { IconName } from "@/data/categories";

const iconMap: Record<IconName, LucideIcon> = {
  pill: Pill,
  clock: Clock,
  cross: Cross,
  "heart-pulse": HeartPulse,
  stethoscope: Stethoscope,
  zap: Zap,
  bed: Bed,
  utensils: Utensils,
  car: Car,
  scissors: Scissors,
  stamp: Stamp,
  package: Package,
  "shopping-cart": ShoppingCart,
  banknote: Banknote,
  fuel: Fuel,
  paw: PawPrint,
  building: Building2,
  shield: Shield,
  "shopping-bag": ShoppingBag,
  wrench: Wrench,
  key: Key,
};

interface CategoryIconProps {
  name: IconName;
  className?: string;
  strokeWidth?: number;
}

export default function CategoryIcon({
  name,
  className = "h-6 w-6",
  strokeWidth = 2,
}: CategoryIconProps) {
  const Icon = iconMap[name];
  return <Icon className={className} strokeWidth={strokeWidth} />;
}

export function getCategoryIcon(name: IconName): LucideIcon {
  return iconMap[name];
}
