{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "icon",
  "dependencies": [
    "lucide-static",
    "simple-icons"
  ],
  "files": [
    {
      "path": "src/components/ui/icon/icon.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\ntype Props = Omit<HTMLAttributes<\"svg\">, \"name\" | \"href\"> & {\n  href?: HTMLAttributes<\"a\">[\"href\"]\n  name?: string | number | null\n}\n\nconst { name, href, ...props } = Astro.props\n\nconst hrefMap = {\n  \"x.com\": \"x\",\n  twitter: \"twitter\",\n  facebook: \"facebook\",\n  instagram: \"instagram\",\n  pinterest: \"pinterest\",\n  youtube: \"youtube\",\n  tiktok: \"tiktok\",\n  snapchat: \"snapchat\",\n  reddit: \"reddit\",\n  tumblr: \"tumblr\",\n  \"wa.me\": \"whatsapp\",\n  telegram: \"telegram\",\n  discord: \"discord\",\n  vimeo: \"vimeo\",\n  flickr: \"flickr\",\n  yelp: \"yelp\",\n  spotify: \"spotify\",\n  behance: \"behance\",\n  dribbble: \"dribbble\",\n  soundcloud: \"soundcloud\",\n  github: \"github\",\n  twitch: \"twitch\",\n  \"tel:\": \"phone\",\n  \"mailto:\": \"mail\",\n  \"maps.app.goo.gl\": \"map-pin\",\n  linkedin: \"linkedin\",\n} as const\n\nconst icons = import.meta.glob(\n  [\n    \"/node_modules/lucide-static/icons/*.svg\",\n    \"/node_modules/simple-icons/icons/*.svg\",\n  ],\n  { eager: true }\n) as Record<string, { default: any }>\n\nconst foundPath = () => {\n  let foundPath: string | undefined = undefined\n\n  // For x.com, use the Simple Icons X instead of Lucide's X icon.\n  if (name === \"x.com\") {\n    foundPath = \"/node_modules/simple-icons/icons/x.svg\"\n  } else if (name) {\n    foundPath = Object.keys(icons).find((key) => key.includes(`/${name}.svg`))\n  } else if (href) {\n    const hrefKey = Object.keys(hrefMap).find((key) =>\n      href.toString().includes(key)\n    )\n    const hrefValue = hrefMap[hrefKey as keyof typeof hrefMap]\n    foundPath = Object.keys(icons)\n      .reverse()\n      .find((key) => key.includes(`/${hrefValue}.svg`))\n  }\n\n  return foundPath\n}\n\nconst iconPath = foundPath()\nconst module = iconPath ? icons[iconPath] : undefined\nconst Comp = module?.default\n---\n\n{\n  Comp && foundPath()?.includes(\"simple-icons\") && (\n    <Comp\n      height={24}\n      width={24}\n      fill=\"currentColor\"\n      class=\"size-[1em] text-base\"\n      {...props}\n    />\n  )\n}\n\n{\n  Comp && foundPath()?.includes(\"lucide-static\") && (\n    <Comp\n      height={24}\n      width={24}\n      fill=\"none\"\n      class=\"size-[1em] text-base\"\n      {...props}\n    />\n  )\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "src/components/ui/icon/index.ts",
      "content": "export { default as Icon } from \"./icon.astro\"\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}