{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "error-pages-05",
  "description": "A signed-out page saying why the session ended and whether unsaved work was kept, with a sign-in link back to the same page.",
  "registryDependencies": [
    "button",
    "https://www.dashboardblocks.com/r/radix/error-pages.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/error-pages/error-pages-05.tsx",
      "content": "'use client'\n\nimport { ErrorPageLayout } from '@/registry/components/dashboardblocks/error-pages'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport type { ReactNode } from 'react'\n\nimport { buttonVariants } from '@/components/ui/button'\n\ntype SessionEndReason =\n  | 'inactive'\n  | 'left'\n  | 'signed-out'\n  | 'signed-out-elsewhere'\n  | 'password-changed'\n  | 'revoked'\n  | 'workspace-deleted'\n\ninterface ErrorPages5Props {\n  brand?: ReactNode\n  email?: string\n  /** Minutes of inactivity before sign-out, for the `inactive` reason. */\n  idleMinutes?: number\n  reason: SessionEndReason\n  returnTo?: string\n  savedDraft?: boolean\n  signInHref: string\n}\n\nconst exampleProps: ErrorPages5Props = {\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  email: 'amara@acme.co',\n  idleMinutes: 30,\n  reason: 'inactive',\n  returnTo: '/dashboards/revenue-overview',\n  savedDraft: true,\n  signInHref: '#',\n}\n\nconst reasons: Record<SessionEndReason, (idleMinutes: number) => string> = {\n  inactive: (minutes) =>\n    `You were signed out after ${minutes} minutes without activity, to keep your account safe.`,\n  left: () => 'You’re no longer a member. Ask an admin for a new invite to come back.',\n  'password-changed': () =>\n    'Your password was changed, so every device was signed out. Sign in with the new password.',\n  revoked: () => 'An admin ended your session. Sign in again to carry on.',\n  'signed-out': () => 'You signed out. Sign in again to carry on.',\n  'signed-out-elsewhere': () => 'You signed out in another tab or window.',\n  'workspace-deleted': () =>\n    'Its projects, keys and history are gone, and everyone in it was signed out.',\n}\n\nconst titles: Partial<Record<SessionEndReason, string>> = {\n  left: 'You left the workspace',\n  'signed-out': 'You’re signed out',\n  'workspace-deleted': 'The workspace was deleted',\n}\n\nfunction withReturnTo(href: string, returnTo?: string) {\n  if (!returnTo) return href\n  const [path, hash = ''] = href.split('#')\n  const joiner = path.includes('?') ? '&' : '?'\n  return `${path}${joiner}returnTo=${encodeURIComponent(returnTo)}${hash ? `#${hash}` : ''}`\n}\n\nconst ErrorPages5 = ({\n  brand,\n  email,\n  idleMinutes = 30,\n  reason,\n  returnTo,\n  savedDraft = false,\n  signInHref,\n}: ErrorPages5Props) => (\n  <ErrorPageLayout\n    brand={brand}\n    title={titles[reason] ?? 'Your session has ended'}\n    description={reasons[reason](idleMinutes)}\n  >\n    <div className='flex flex-col gap-4 border-t pt-6'>\n      {savedDraft && (\n        <p className='flex items-start gap-2 text-sm [&_svg]:mt-0.5 [&_svg]:size-4 [&_svg]:shrink-0'>\n          <IconPlaceholder\n            lucide='SaveIcon'\n            tabler='IconDeviceFloppy'\n            hugeicons='FloppyDiskIcon'\n            phosphor='FloppyDiskIcon'\n            remixicon='RiSave3Line'\n            aria-hidden\n            className='text-muted-foreground'\n          />\n          Your unsaved changes were kept as a draft. They’ll be there when you sign back\n          in.\n        </p>\n      )}\n      <div className='flex flex-wrap items-center gap-x-4 gap-y-3'>\n        <a href={withReturnTo(signInHref, returnTo)} className={buttonVariants()}>\n          {email ? `Sign in as ${email}` : 'Sign in again'}\n        </a>\n        {email && (\n          <a\n            href={signInHref}\n            className='text-muted-foreground hover:text-foreground text-sm underline underline-offset-4'\n          >\n            Use another account\n          </a>\n        )}\n      </div>\n    </div>\n  </ErrorPageLayout>\n)\n\nexport {\n  ErrorPages5,\n  exampleProps as errorPages5ExampleProps,\n  type ErrorPages5Props,\n  type SessionEndReason,\n}\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/error-pages/error-pages-05.tsx"
    }
  ],
  "meta": {
    "shows": "A signed-out page saying why the session ended and whether unsaved work was kept, with a sign-in link back to the same page.",
    "size": "page",
    "usedWith": [
      "auth-03"
    ],
    "component": "ErrorPages5",
    "props": "{ brand?: ReactNode; email?: string; idleMinutes?: number; reason: \"revoked\" | \"inactive\" | \"left\" | \"signed-out\" | \"signed-out-elsewhere\" | \"password-changed\" | \"workspace-deleted\"; returnTo?: string; savedDraft?: boolean; signInHref: string }"
  },
  "type": "registry:component"
}
