{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "entity-image",
  "title": "Entity Image",
  "description": "Team or region logo, unstyled; falls back to initials when the image is missing.",
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/mrdoge-ui/entity-image/entity-image.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface EntityImageProps {\n  src?: string | null\n  /** Used for the alt text and the initials fallback. */\n  name: string\n  size?: \"sm\" | \"default\" | \"lg\"\n  className?: string\n}\n\nconst sizeClass: Record<NonNullable<EntityImageProps[\"size\"]>, string> = {\n  sm: \"size-5\",\n  default: \"size-8\",\n  lg: \"size-10\",\n}\n\n/**\n * Just the image: no background, border, or corner radius, so team crests\n * and region flags render at their native shape. Pass a `className` (e.g.\n * `size-6`) to override the size; it takes precedence over `size`.\n */\nexport function EntityImage({ src, name, size = \"default\", className }: EntityImageProps) {\n  const [errored, setErrored] = useState(false)\n\n  if (!src || errored) {\n    return (\n      <span\n        className={cn(\n          \"flex shrink-0 items-center justify-center rounded-full bg-muted text-[0.6rem] font-medium text-muted-foreground\",\n          sizeClass[size],\n          className\n        )}\n      >\n        {name.slice(0, 2).toUpperCase()}\n      </span>\n    )\n  }\n\n  return (\n    // eslint-disable-next-line @next/next/no-img-element -- framework-agnostic registry component, no next/image dependency\n    <img\n      src={src}\n      alt={name}\n      className={cn(\"shrink-0 object-contain\", sizeClass[size], className)}\n      onError={() => setErrored(true)}\n    />\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}