// @bun
// src/presentation/features/atoms/FeatureIcon/FeatureIcon.tsx
import * as React from "react";
import {
  FileText,
  Boxes,
  Settings,
  Globe,
  Shield,
  Database,
  MessageSquare,
  Layout,
  Workflow
} from "lucide-react";
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
import { jsx } from "react/jsx-runtime";
"use client";
var domainIconMap = {
  platform: Settings,
  documentation: FileText,
  docs: FileText,
  integration: Workflow,
  api: Globe,
  security: Shield,
  data: Database,
  messaging: MessageSquare,
  ui: Layout,
  presentation: Layout
};
var tagIconMap = {
  documentation: FileText,
  guides: FileText,
  "api-reference": Globe,
  presentations: Layout,
  ui: Layout,
  rendering: Layout,
  mcp: Workflow,
  integration: Workflow,
  security: Shield,
  auth: Shield,
  data: Database,
  storage: Database
};
var stabilityToneMap = {
  stable: "success",
  beta: "warning",
  experimental: "info",
  deprecated: "danger"
};
var sizeClasses = {
  sm: "h-4 w-4",
  md: "h-5 w-5",
  lg: "h-6 w-6"
};
function FeatureIcon({
  domain,
  tags = [],
  stability,
  icon: IconOverride,
  size = "md",
  className
}) {
  const Icon = React.useMemo(() => {
    if (IconOverride)
      return IconOverride;
    if (domain) {
      const domainIcon = domainIconMap[domain.toLowerCase()];
      if (domainIcon)
        return domainIcon;
    }
    for (const tag of tags) {
      const tagIcon = tagIconMap[tag.toLowerCase()];
      if (tagIcon)
        return tagIcon;
    }
    return Boxes;
  }, [domain, tags, IconOverride]);
  const tone = stability ? stabilityToneMap[stability] || "primary" : "primary";
  const toneClasses = {
    success: "text-emerald-600 dark:text-emerald-400",
    warning: "text-amber-600 dark:text-amber-400",
    info: "text-blue-600 dark:text-blue-400",
    danger: "text-red-600 dark:text-red-400",
    primary: "text-primary"
  };
  return /* @__PURE__ */ jsx(Icon, {
    className: cn(sizeClasses[size], toneClasses[tone], className)
  });
}
function getFeatureIconTone(stability) {
  if (!stability)
    return "primary";
  return stabilityToneMap[stability] || "primary";
}
export {
  getFeatureIconTone,
  FeatureIcon
};
