{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shell-login-failure",
  "title": "Login failure notice",
  "description": "Reads the sign-in redirect's own query string and words why sign-in did not complete.",
  "registryDependencies": [
    "@registrystack/lib-content",
    "@registrystack/lib-format",
    "@registrystack/lib-notice",
    "@registrystack/shell-content"
  ],
  "files": [
    {
      "path": "shell/login-failure.tsx",
      "content": "import { useLocale } from \"@/blocks/lib/content\";\nimport { fillNodes } from \"@/blocks/lib/format\";\nimport { Notice } from \"@/blocks/lib/notice\";\nimport { useShellContent } from \"@/blocks/shell/shell-content\";\n\n/** Reads the sign-in redirect's own query string; nothing renders without one. */\nexport function LoginFailure() {\n  const c = useShellContent();\n  const locale = useLocale();\n  const params = new URLSearchParams(location.search);\n  const code = params.get(\"loginError\");\n  if (!code) return null;\n  const reference = params.get(\"reference\");\n  return (\n    <Notice tone=\"warning\" title={c.loginFailureTitle}>\n      <p>\n        {code === \"unmapped\"\n          ? c.loginUnmapped\n          : code === \"expired\"\n            ? c.loginExpired\n            : code === \"access\"\n              ? c.loginAccess\n              : c.loginUnavailable}\n      </p>\n      {reference && /^[a-zA-Z0-9_-]{1,128}$/.test(reference) && (\n        <p className=\"reference\">\n          {fillNodes(\n            c.receiptLine,\n            {\n              label: c.receipt,\n              value: <span className=\"font-mono\">{reference}</span>,\n            },\n            locale,\n          )}\n        </p>\n      )}\n    </Notice>\n  );\n}\n",
      "type": "registry:block",
      "target": "@components/shell/login-failure.tsx"
    }
  ],
  "type": "registry:block"
}