{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "admin-cell",
  "title": "Admin cell",
  "description": "A cell for a list or report column.",
  "files": [
    {
      "path": "registry/admin-cell.tsx",
      "content": "import { AdminLink, type CellProps, type SurfaceProp } from \"@aotter/mantle-admin/app\";\n\n/**\n * Surface: both (the browser, and the Admin MCP App in an MCP host's sandboxed iframe).\n * Slots: cell:view:<view>.<column>\n * Rules: read data only through @aotter/mantle-admin/hooks, link only with <AdminLink> or useOpenLink(), make no\n * network calls of your own, keep no auth in cookies or browser storage, open no windows, assume no width, load\n * nothing from a remote origin. Branch on `surface` if you must; both branches have to render.\n */\n\nconst isWeb = (text: string): boolean => /^https?:\\/\\//i.test(text);\n\n/** One value in a list or report: a pill for text, a link for a web address. Narrow `CellProps` to your field's type. */\nexport function AdminCell({ value }: CellProps<unknown, object> & SurfaceProp) {\n  if (value === null || value === undefined || value === \"\") return <span className=\"text-muted-foreground\">-</span>;\n  const text = typeof value === \"string\" ? value : JSON.stringify(value);\n  if (isWeb(text)) return <AdminLink href={text} className=\"text-primary underline-offset-4 hover:underline\">{text}</AdminLink>;\n  return <span className=\"inline-block max-w-full truncate rounded-md bg-muted px-2 py-0.5 text-xs font-medium\">{text}</span>;\n}\n",
      "type": "registry:component",
      "target": "~/src/admin/admin-cell.tsx"
    }
  ],
  "meta": {
    "surface": "both",
    "slots": [
      "cell:view:<view>.<column>"
    ]
  },
  "type": "registry:component"
}