import type React from "react"
import {
  Add01Icon,
  Alert01Icon,
  AlignBoxBottomCenterIcon,
  AlignBoxMiddleCenterIcon,
  AlignBoxTopCenterIcon,
  ArrowDown01Icon,
  ArrowDown02Icon,
  ArrowExpandDiagonal01Icon,
  ArrowExpandDiagonal02Icon,
  ArrowLeft01Icon,
  ArrowLeftRightIcon,
  ArrowRight01Icon,
  ArrowUp01Icon,
  ArrowUp02Icon,
  ArrowUpDownIcon,
  ArrowUpRight01Icon,
  Attachment01Icon,
  Book01Icon,
  BorderAll01Icon,
  BorderBottom01Icon,
  BorderHorizontalIcon,
  BorderInnerIcon,
  BorderLeft01Icon,
  BorderNone01Icon,
  BorderRight01Icon,
  BorderTop01Icon,
  BorderVerticalIcon,
  BrushIcon,
  BubbleChatIcon,
  Calendar03Icon,
  Camera01Icon,
  Cancel01Icon,
  CancelCircleIcon,
  CellsIcon,
  CheckIcon,
  CheckmarkCircle01Icon,
  CheckmarkSquare01Icon,
  ChevronDown,
  ChevronDownIcon,
  ChevronUp,
  CircleIcon,
  ClipboardIcon,
  ColorPickerIcon,
  ColumnsThreeCogIcon,
  Comment01Icon,
  CommentAdd01Icon,
  Copy01Icon,
  Cursor01Icon,
  CursorRectangleSelection01Icon,
  CursorTextIcon,
  Delete02Icon,
  DollarCircleIcon,
  Download01Icon,
  DragDropVerticalIcon,
  DropletOffIcon,
  EditOffIcon,
  ExternalLinkIcon,
  File01Icon,
  FileAddIcon,
  FileDiffIcon,
  FileImageIcon,
  FilePenIcon,
  FileSpreadsheetIcon,
  FileUploadIcon,
  FilterIcon,
  Flag01Icon,
  FloppyDiskIcon,
  FullScreenIcon,
  GalleryThumbnailsIcon,
  GitMergeIcon,
  Grid2X2XIcon,
  GridViewIcon,
  GroupItemsIcon,
  HandIcon,
  Heading01Icon,
  HighlighterIcon,
  Image01Icon,
  ImageAdd01Icon,
  ImageCompositionIcon,
  InformationCircleIcon,
  InputNumericIcon,
  InputTextIcon,
  Key01Icon,
  KeyboardIcon,
  Layers01Icon,
  LayoutThreeColumnIcon,
  LeftToRightListBulletIcon,
  LeftToRightListNumberIcon,
  LineIcon,
  Link02Icon,
  ListTreeIcon,
  Loading03Icon,
  MinimizeScreenIcon,
  MinusSignCircleIcon,
  MinusSignIcon,
  Moon02Icon,
  MoreHorizontalIcon,
  MoveIcon,
  PaintBoardIcon,
  PaintBucketIcon,
  ParagraphIcon,
  PathfinderMergeIcon,
  Pen01Icon,
  PencilEdit01Icon,
  PercentIcon,
  PlusSignCircleIcon,
  PolygonIcon,
  PrinterIcon,
  RadioButtonIcon,
  Redo02Icon,
  RefreshIcon,
  ReplaceIcon,
  RotateClockwiseIcon,
  Scissor01Icon,
  Search01Icon,
  SecondBracketIcon,
  Shield01Icon,
  SidebarLeftIcon,
  SidebarRightIcon,
  SignatureIcon,
  SlidersHorizontalIcon,
  SourceCodeSquareIcon,
  SparklesIcon,
  SplinePointerIcon,
  SquareIcon,
  SquareLock02Icon,
  SquareUnlock02Icon,
  StampIcon,
  StickyNote01Icon,
  Sun03Icon,
  Table01Icon,
  TableIcon,
  TableRowsSplitIcon,
  TextAlignCenterIcon,
  TextAlignJustifyLeftIcon,
  TextAlignLeft01Icon,
  TextAlignRight01Icon,
  TextBoldIcon,
  TextCenterlineCenterTopIcon,
  TextCheckIcon,
  TextColorIcon,
  TextFontIcon,
  TextIcon,
  TextItalicIcon,
  TextNumberSignIcon,
  TextStrikethroughIcon,
  TextSubscriptIcon,
  TextSuperscriptIcon,
  TextUnderlineIcon,
  TextWrapIcon,
  Tick02Icon,
  Undo02Icon,
  UnfoldMoreIcon,
  UngroupItemsIcon,
  Upload01Icon,
  ViewIcon,
  ViewOffIcon,
  WaveIcon,
  ZoomInAreaIcon,
} from "@hugeicons/core-free-icons"
import { HugeiconsIcon } from "@hugeicons/react"

// The registry source files reference icons through <IconPlaceholder /> with a
// per-library icon name for every icon library the shadcn CLI supports. At
// install time the CLI replaces the placeholder with the consumer's configured
// `iconLibrary` from components.json and strips this import. This component is
// only ever rendered on this docs site, which uses hugeicons.
//
// When a registry component starts using a new icon, add its hugeicons name
// here — the `hugeicons` prop is typed against this registry, so a missing
// entry is a type error.
const hugeicons = {
  Add01Icon,
  Alert01Icon,
  AlignBoxBottomCenterIcon,
  AlignBoxMiddleCenterIcon,
  AlignBoxTopCenterIcon,
  ArrowDown01Icon,
  ArrowDown02Icon,
  ArrowExpandDiagonal01Icon,
  ArrowExpandDiagonal02Icon,
  ArrowLeft01Icon,
  ArrowLeftRightIcon,
  ArrowRight01Icon,
  ArrowUp01Icon,
  ArrowUp02Icon,
  ArrowUpDownIcon,
  ArrowUpRight01Icon,
  Attachment01Icon,
  Book01Icon,
  BorderAll01Icon,
  BorderBottom01Icon,
  BorderHorizontalIcon,
  BorderInnerIcon,
  BorderLeft01Icon,
  BorderNone01Icon,
  BorderRight01Icon,
  BorderTop01Icon,
  BorderVerticalIcon,
  BrushIcon,
  BubbleChatIcon,
  Calendar03Icon,
  Camera01Icon,
  Cancel01Icon,
  CancelCircleIcon,
  CellsIcon,
  CheckIcon,
  CheckmarkCircle01Icon,
  CheckmarkSquare01Icon,
  ChevronDown,
  ChevronDownIcon,
  ChevronUp,
  CircleIcon,
  ClipboardIcon,
  ColumnsThreeCogIcon,
  Comment01Icon,
  CommentAdd01Icon,
  ColorPickerIcon,
  Copy01Icon,
  Cursor01Icon,
  CursorRectangleSelection01Icon,
  CursorTextIcon,
  Delete02Icon,
  DollarCircleIcon,
  Download01Icon,
  DragDropVerticalIcon,
  DropletOffIcon,
  EditOffIcon,
  ExternalLinkIcon,
  File01Icon,
  FileAddIcon,
  FileDiffIcon,
  FileImageIcon,
  FilePenIcon,
  FileSpreadsheetIcon,
  FileUploadIcon,
  FilterIcon,
  Flag01Icon,
  FloppyDiskIcon,
  FullScreenIcon,
  GalleryThumbnailsIcon,
  GitMergeIcon,
  Grid2X2XIcon,
  GridViewIcon,
  GroupItemsIcon,
  HandIcon,
  Heading01Icon,
  HighlighterIcon,
  Image01Icon,
  ImageAdd01Icon,
  ImageCompositionIcon,
  InformationCircleIcon,
  InputNumericIcon,
  InputTextIcon,
  Key01Icon,
  KeyboardIcon,
  Layers01Icon,
  LayoutThreeColumnIcon,
  LeftToRightListBulletIcon,
  LeftToRightListNumberIcon,
  LineIcon,
  Link02Icon,
  ListTreeIcon,
  Loading03Icon,
  MinimizeScreenIcon,
  MinusSignCircleIcon,
  MinusSignIcon,
  Moon02Icon,
  MoreHorizontalIcon,
  MoveIcon,
  PaintBoardIcon,
  PaintBucketIcon,
  ParagraphIcon,
  PathfinderMergeIcon,
  Pen01Icon,
  PencilEdit01Icon,
  PercentIcon,
  PlusSignCircleIcon,
  PolygonIcon,
  PrinterIcon,
  RadioButtonIcon,
  Redo02Icon,
  RefreshIcon,
  ReplaceIcon,
  RotateClockwiseIcon,
  Scissor01Icon,
  Search01Icon,
  SecondBracketIcon,
  Shield01Icon,
  SidebarLeftIcon,
  SidebarRightIcon,
  SignatureIcon,
  SlidersHorizontalIcon,
  SourceCodeSquareIcon,
  SparklesIcon,
  SplinePointerIcon,
  SquareIcon,
  SquareLock02Icon,
  SquareUnlock02Icon,
  StampIcon,
  StickyNote01Icon,
  Sun03Icon,
  Table01Icon,
  TableIcon,
  TableRowsSplitIcon,
  TextAlignCenterIcon,
  TextAlignJustifyLeftIcon,
  TextAlignLeft01Icon,
  TextAlignRight01Icon,
  TextBoldIcon,
  TextCenterlineCenterTopIcon,
  TextCheckIcon,
  TextColorIcon,
  TextFontIcon,
  TextIcon,
  TextItalicIcon,
  TextNumberSignIcon,
  TextStrikethroughIcon,
  TextSubscriptIcon,
  TextSuperscriptIcon,
  TextUnderlineIcon,
  TextWrapIcon,
  Tick02Icon,
  Undo02Icon,
  UnfoldMoreIcon,
  UngroupItemsIcon,
  Upload01Icon,
  ViewIcon,
  ViewOffIcon,
  WaveIcon,
  ZoomInAreaIcon,
}

export type IconPlaceholderProps = {
  lucide: string
  tabler: string
  hugeicons: keyof typeof hugeicons
  phosphor: string
  remixicon: string
} & React.ComponentProps<"svg">

export function IconPlaceholder(props: IconPlaceholderProps) {
  const {
    lucide: _lucide,
    tabler: _tabler,
    hugeicons: hugeiconsName,
    phosphor: _phosphor,
    remixicon: _remixicon,
    ...rest
  } = props

  return (
    <HugeiconsIcon
      icon={hugeicons[hugeiconsName]}
      {...(rest as Omit<React.ComponentProps<typeof HugeiconsIcon>, "icon">)}
    />
  )
}
