{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alerts",
  "title": "Alerts",
  "description": "Primitives for alerts: critical, warning, info and resolved severities written as coloured words, plus relative time formatting.",
  "registryDependencies": [
    "https://www.dashboardblocks.com/r/radix/status-label.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/alerts.tsx",
      "content": "'use client'\n\nimport {\n  StatusLabel,\n  type StatusLabelProps,\n  type StatusTone,\n} from '@/registry/components/dashboardblocks/status-label'\n\ntype AlertSeverity = 'critical' | 'warning' | 'info' | 'resolved'\n\ninterface SeverityConfig {\n  label: string\n  tone: StatusTone\n}\n\nconst severityConfig: Record<AlertSeverity, SeverityConfig> = {\n  critical: { label: 'Critical', tone: 'bad' },\n  info: { label: 'Info', tone: 'info' },\n  resolved: { label: 'Resolved', tone: 'good' },\n  warning: { label: 'Warning', tone: 'warning' },\n}\n\nconst severityOrder: AlertSeverity[] = ['critical', 'warning', 'info', 'resolved']\n\ninterface SeverityLabelProps extends Omit<StatusLabelProps, 'tone'> {\n  severity: AlertSeverity\n}\n\nfunction SeverityLabel({ children, severity, ...props }: SeverityLabelProps) {\n  const config = severityConfig[severity]\n  return (\n    <StatusLabel data-severity={severity} tone={config.tone} {...props}>\n      {children ?? config.label}\n    </StatusLabel>\n  )\n}\n\nexport { SeverityLabel, severityConfig, severityOrder }\n\nexport type { AlertSeverity, SeverityConfig, SeverityLabelProps }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/alerts.tsx"
    }
  ],
  "type": "registry:component"
}
