{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status-03",
  "description": "An active incident with its severity, affected components and a timeline of updates.",
  "registryDependencies": [
    "card",
    "button",
    "https://www.dashboardblocks.com/r/radix/activity-feed.json",
    "https://www.dashboardblocks.com/r/radix/block-state.json",
    "https://www.dashboardblocks.com/r/radix/status.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/status/status-03.tsx",
      "content": "'use client'\n\nimport {\n  ActivityFeed,\n  ActivityFeedItem,\n} from '@/registry/components/dashboardblocks/activity-feed'\nimport {\n  BlockReady,\n  BlockStateProvider,\n  BlockStateRows,\n  type BlockStateProps,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  StatusIndicator,\n  type StatusLevel,\n} from '@/registry/components/dashboardblocks/status'\nimport { IconPlaceholder } from '@/registry/icons/icon-placeholder'\nimport { formatList } from '@/registry/lib/dashboardblocks/format'\n\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent } from '@/components/ui/card'\n\nimport { cn } from '@/lib/utils'\n\ninterface IncidentUpdate {\n  message: string\n  stage: 'Investigating' | 'Identified' | 'Monitoring' | 'Resolved'\n  time: string\n}\n\ninterface Status3Props extends BlockStateProps {\n  affected: string[]\n  onSubscribe?: () => void\n  severity: StatusLevel\n  started: string\n  title: string\n  /** Newest first. Leave out, or pass none, to show the empty state. */\n  updates?: IncidentUpdate[]\n}\n\nconst exampleProps: Status3Props = {\n  affected: ['API', 'Webhooks'],\n  severity: 'partial',\n  started: 'Started today at 14:02 UTC',\n  title: 'Elevated API error rates',\n  updates: [\n    {\n      message:\n        'A fix has been deployed and error rates are back to normal. We are monitoring the results.',\n      stage: 'Monitoring',\n      time: '14:40 UTC',\n    },\n    {\n      message:\n        'We traced the errors to a misconfigured load balancer in us-east-1 and are rolling back.',\n      stage: 'Identified',\n      time: '14:18 UTC',\n    },\n    {\n      message: 'We are investigating increased 5xx responses on API requests.',\n      stage: 'Investigating',\n      time: '14:05 UTC',\n    },\n  ],\n}\n\nconst Status3 = (props: Status3Props) => {\n  const {\n    affected,\n    onSubscribe,\n    severity,\n    started,\n    errorMessage,\n    status,\n    title,\n    updates = [],\n  } = props\n  const state = getBlockState(status, updates)\n\n  return (\n    <Card>\n      <CardContent>\n        <BlockStateProvider errorMessage={errorMessage} state={state}>\n          <section className='@container flex flex-col gap-4'>\n            <header className='flex flex-wrap items-start justify-between gap-3'>\n              <div className='flex min-w-0 flex-col gap-1'>\n                <BlockReady className='w-32 text-sm'>\n                  <StatusIndicator status={severity} />\n                </BlockReady>\n                <h2 className='font-semibold tracking-tight text-balance'>{title}</h2>\n                <BlockReady className='text-sm'>\n                  <p className='text-muted-foreground text-sm'>\n                    {[started, affected.length > 0 && `Affects ${formatList(affected)}`]\n                      .filter(Boolean)\n                      .map((sentence) => `${sentence}.`)\n                      .join(' ')}\n                  </p>\n                </BlockReady>\n              </div>\n              <Button variant='outline' size='sm' onClick={onSubscribe}>\n                <IconPlaceholder\n                  lucide='BellIcon'\n                  tabler='IconBell'\n                  hugeicons='NotificationIcon'\n                  phosphor='BellIcon'\n                  remixicon='RiNotificationLine'\n                  data-icon='inline-start'\n                />\n                Subscribe\n              </Button>\n            </header>\n            {state && (\n              <div className='border-t'>\n                <BlockStateRows rows={3} />\n              </div>\n            )}\n            {!state && (\n              <ActivityFeed className='border-t pt-4 [--activity-marker:0.75rem]'>\n                {updates.map((update, index) => (\n                  <ActivityFeedItem\n                    key={`${update.stage}-${update.time}`}\n                    connector\n                    className='pb-5 last:pb-0'\n                  >\n                    <span\n                      aria-hidden\n                      className={cn(\n                        'ring-background relative mt-1 size-(--activity-marker) shrink-0 rounded-full ring-4',\n                        index === 0 ? 'bg-foreground' : 'bg-muted-foreground/40',\n                      )}\n                    />\n                    <div className='flex min-w-0 flex-col gap-1'>\n                      <p className='flex flex-wrap items-baseline gap-x-2 text-sm'>\n                        <span className='font-medium'>{update.stage}</span>\n                        <span className='text-muted-foreground text-xs tabular-nums'>\n                          {update.time}\n                        </span>\n                      </p>\n                      <p className='text-muted-foreground text-sm text-pretty'>\n                        {update.message}\n                      </p>\n                    </div>\n                  </ActivityFeedItem>\n                ))}\n              </ActivityFeed>\n            )}\n          </section>\n        </BlockStateProvider>\n      </CardContent>\n    </Card>\n  )\n}\n\nexport { Status3, exampleProps as status3ExampleProps, type Status3Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/status/status-03.tsx"
    }
  ],
  "meta": {
    "shows": "An active incident with its severity, affected components and a timeline of updates.",
    "size": "half",
    "usedWith": [
      "status-01",
      "status-02",
      "alerts-01"
    ],
    "component": "Status3",
    "props": "{ affected: string[]; onSubscribe?: () => void; severity: \"operational\" | \"degraded\" | \"partial\" | \"major\" | \"maintenance\" | \"unknown\"; started: string; title: string; updates?: { message: string; stage: \"Investigating\" | \"Identified\" | \"Monitoring\" | \"Resolved\"; time: string }[]; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
