{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "network-badge",
  "title": "Network badge",
  "description": "Neutral network, node-type and ecosystem labels. Network types appear in words.",
  "registryDependencies": [
    "@dwellir/dwellir-theme",
    "@dwellir/utils",
    "@dwellir/badge"
  ],
  "files": [
    {
      "path": "components/ui/network-badge.tsx",
      "content": "import type { ComponentProps, ReactNode } from 'react';\nimport { Badge } from '@/components/ui/badge';\n\ntype IdentityBadgeProps = Omit<ComponentProps<'span'>, 'children'> & { children: ReactNode };\ntype NetworkType = 'mainnet' | 'testnet' | 'canary' | 'devnet';\ntype NetworkBadgeProps = Omit<IdentityBadgeProps, 'children'> & {\n  name: string;\n  type: NetworkType;\n  /** A decorative ChainIcon when the label names a chain. */\n  icon?: ReactNode;\n};\n\nconst TYPE_WORDS: Record<NetworkType, RegExp> = {\n  mainnet: /\\bmain[\\s-]?net\\b/i,\n  testnet: /\\btest[\\s-]?net\\b/i,\n  canary: /\\bcanary\\b/i,\n  devnet: /\\bdev[\\s-]?net\\b/i,\n};\n\nfunction NetworkBadge({ name, type, icon, ...props }: NetworkBadgeProps) {\n  const label = name.trim();\n  return (\n    <Badge {...props} data-slot=\"network-badge\" data-network-type={type} variant=\"neutral\">\n      {icon}\n      {TYPE_WORDS[type].test(label) ? label : `${label} ${type}`.trim()}\n    </Badge>\n  );\n}\n\nfunction NodeTypeBadge(props: IdentityBadgeProps) {\n  return <Badge {...props} data-slot=\"node-type-badge\" variant=\"neutral\" />;\n}\n\nfunction EcosystemBadge(props: IdentityBadgeProps) {\n  return <Badge {...props} data-slot=\"ecosystem-badge\" variant=\"neutral\" />;\n}\n\nexport type { IdentityBadgeProps, NetworkBadgeProps, NetworkType };\nexport { EcosystemBadge, NetworkBadge, NodeTypeBadge };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}