import type { SVGProps } from "react";
import type { FeatureIconName } from "@/data/home";
import { CardIcon, DollarIcon, LockIcon, ShieldIcon, UsersIcon } from "./Icons";

const icons: Record<FeatureIconName, (props: SVGProps<SVGSVGElement>) => React.JSX.Element> = {
  card: CardIcon,
  shield: ShieldIcon,
  dollar: DollarIcon,
  lock: LockIcon,
  users: UsersIcon,
};

export function FeatureIcon({
  name,
  ...props
}: { name: FeatureIconName } & SVGProps<SVGSVGElement>) {
  const Icon = icons[name];
  return <Icon {...props} />;
}
