{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "error-pages-03",
  "description": "A failure page with a retry button and count, a copyable error ID for support and the technical details folded away.",
  "registryDependencies": [
    "button",
    "https://www.dashboardblocks.com/r/radix/disclosure.json",
    "https://www.dashboardblocks.com/r/radix/settings.json",
    "https://www.dashboardblocks.com/r/radix/error-pages.json",
    "https://www.dashboardblocks.com/r/radix/highlighted-code.json",
    "https://www.dashboardblocks.com/r/radix/format.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/error-pages/error-pages-03.tsx",
      "content": "'use client'\n\nimport {\n  Disclosure,\n  DisclosureContent,\n  DisclosureTrigger,\n} from '@/registry/components/dashboardblocks/disclosure'\nimport { ErrorPageLayout } from '@/registry/components/dashboardblocks/error-pages'\nimport { HighlightedCode } from '@/registry/components/dashboardblocks/highlighted-code'\nimport { CopyButton } from '@/registry/components/dashboardblocks/settings'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { formatDate } from '@/registry/lib/dashboardblocks/format'\nimport { type ReactNode, startTransition, useState } from 'react'\n\nimport { Button, buttonVariants } from '@/components/ui/button'\n\ninterface ErrorPages3Props {\n  brand?: ReactNode\n  details?: string\n  errorId: string\n  occurredAt: Date\n  onRetry?: () => void | Promise<void>\n  statusHref?: string\n  supportEmail?: string\n}\n\nconst exampleProps: ErrorPages3Props = {\n  brand: (\n    <>\n      <span className='bg-primary text-primary-foreground flex size-7 items-center justify-center rounded-md [&_svg]:size-4'>\n        <IconPlaceholder\n          lucide='BlocksIcon'\n          tabler='IconCube'\n          hugeicons='CubeIcon'\n          phosphor='CubeIcon'\n          remixicon='RiBox3Line'\n        />\n      </span>\n      Acme Analytics\n    </>\n  ),\n  details: 'QueryTimeoutError: warehouse query exceeded 30s (dashboard revenue-overview)',\n  errorId: 'req_7Hq2kX9mP4vB',\n  occurredAt: new Date(Date.UTC(2026, 8, 27, 14, 12)),\n  onRetry: () =>\n    new Promise((_, reject) => setTimeout(() => reject(new Error('Still failing')), 900)),\n  statusHref: '#',\n  supportEmail: 'support@acme.co',\n}\n\nconst ErrorPages3 = (props: ErrorPages3Props) => {\n  const { brand, details, errorId, occurredAt, onRetry, statusHref, supportEmail } = props\n  const [retrying, setRetrying] = useState(false)\n  const [attempts, setAttempts] = useState(0)\n\n  const retry = async () => {\n    setRetrying(true)\n    try {\n      await onRetry?.()\n    } catch {\n      startTransition(() => setAttempts((count) => count + 1))\n    } finally {\n      startTransition(() => setRetrying(false))\n    }\n  }\n\n  return (\n    <ErrorPageLayout\n      brand={brand}\n      code='500'\n      title='Something went wrong'\n      description='This is on our side, not yours. Your data is safe. Try again in a moment.'\n      footer={\n        statusHref && (\n          <a\n            href={statusHref}\n            className='hover:text-foreground underline underline-offset-4'\n          >\n            Check the status page\n          </a>\n        )\n      }\n    >\n      <div className='flex flex-col gap-2'>\n        <div className='flex flex-wrap gap-2'>\n          {onRetry && (\n            <Button disabled={retrying} onClick={() => void retry()}>\n              <IconPlaceholder\n                lucide='RefreshCwIcon'\n                tabler='IconRefresh'\n                hugeicons='RefreshIcon'\n                phosphor='ArrowClockwiseIcon'\n                remixicon='RiRefreshLine'\n                data-icon='inline-start'\n                aria-hidden\n                className={\n                  retrying ? 'animate-spin motion-reduce:animate-none' : undefined\n                }\n              />\n              {retrying ? 'Trying again' : 'Try again'}\n            </Button>\n          )}\n          {supportEmail && (\n            <a\n              href={`mailto:${supportEmail}?subject=${encodeURIComponent(`Error ${errorId}`)}`}\n              className={buttonVariants({ variant: 'ghost' })}\n            >\n              Contact support\n            </a>\n          )}\n        </div>\n        <p role='status' className='text-muted-foreground min-h-5 text-sm'>\n          {attempts > 0 && !retrying\n            ? `Still not working after ${attempts} ${attempts === 1 ? 'retry' : 'retries'}. Contact support with the error ID below.`\n            : ''}\n        </p>\n      </div>\n\n      <dl className='flex flex-col divide-y border-y text-sm'>\n        <div className='grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 py-2'>\n          <dt className='text-muted-foreground text-xs'>Error ID</dt>\n          <dd className='truncate font-mono'>{errorId}</dd>\n          <dd className='col-start-2 row-span-2 row-start-1'>\n            <CopyButton label='Copy error ID' value={errorId} />\n          </dd>\n        </div>\n        <div className='flex flex-col py-2'>\n          <dt className='text-muted-foreground text-xs'>Time</dt>\n          <dd>\n            <time dateTime={occurredAt.toISOString()}>\n              {formatDate(occurredAt, 'time-zone')}\n            </time>\n          </dd>\n        </div>\n        {details && (\n          <div className='py-2'>\n            <dt className='sr-only'>Details</dt>\n            <dd>\n              <Disclosure>\n                <DisclosureTrigger className='text-xs font-medium [&_svg]:mt-px [&_svg]:size-3.5'>\n                  Details\n                </DisclosureTrigger>\n                <DisclosureContent>\n                  <HighlightedCode\n                    code={details}\n                    title='Error details'\n                    copyLabel='Copy details'\n                    wrap\n                  />\n                </DisclosureContent>\n              </Disclosure>\n            </dd>\n          </div>\n        )}\n      </dl>\n    </ErrorPageLayout>\n  )\n}\n\nexport { ErrorPages3, exampleProps as errorPages3ExampleProps, type ErrorPages3Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/error-pages/error-pages-03.tsx"
    }
  ],
  "meta": {
    "shows": "A failure page with a retry button and count, a copyable error ID for support and the technical details folded away.",
    "size": "page",
    "usedWith": [
      "error-pages-04"
    ],
    "component": "ErrorPages3",
    "props": "{ brand?: ReactNode; details?: string; errorId: string; occurredAt: Date; onRetry?: () => void | Promise<void>; statusHref?: string; supportEmail?: string }"
  },
  "type": "registry:component"
}
