"use client";

import { Sparkles } from "lucide-react";
import { figmaIcons } from "./figma-icons";

/** Renders a Figma-exported icon (recolored to currentColor) or a fallback. */
export function FigIcon({ name, size = 18 }: { name: string; size?: number }) {
  const svg = figmaIcons[name];
  if (!svg) return <Sparkles size={size} />;
  return (
    <span
      className="fig-ic"
      style={{ width: size, height: size }}
      dangerouslySetInnerHTML={{ __html: svg }}
    />
  );
}
