{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notification-rules",
  "title": "Notification routing",
  "description": "Choose where alerts go and test how routine and priority messages behave during quiet hours.",
  "registryDependencies": [
    "https://www.cyberspec.dev/r/recipe-layout.json",
    "https://www.cyberspec.dev/r/badge.json",
    "https://www.cyberspec.dev/r/checkbox.json",
    "https://www.cyberspec.dev/r/select.json",
    "https://www.cyberspec.dev/r/switch.json"
  ],
  "files": [
    {
      "path": "registry/cyber/recipes/notification-rules.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { Badge } from \"@/registry/cyber/ui/badge\"\nimport { Checkbox, CheckboxGroup } from \"@/registry/cyber/ui/checkbox\"\nimport { Select } from \"@/registry/cyber/ui/select\"\nimport { Switch } from \"@/registry/cyber/ui/switch\"\nimport \"./recipe-layout.css\"\n\nconst events = [\n  { value: \"handoff\", label: \"Handoff reminder\", priority: false },\n  { value: \"closure\", label: \"Station closure\", priority: true },\n]\n\nexport default function NotificationRules() {\n  const [destinations, setDestinations] = useState<string[]>([\"Desk\"])\n  const [quiet, setQuiet] = useState(true)\n  const [eventId, setEventId] = useState(\"handoff\")\n  const event = events.find(item => item.value === eventId)!\n  const held = quiet && !event.priority\n  let outcome = `Delivered to ${destinations.join(\" and \")}.`\n  if (!destinations.length) outcome = \"No destinations selected.\"\n  else if (held) outcome = \"Held until quiet hours end.\"\n\n  return (\n    <div className=\"sink-stack\">\n      <CheckboxGroup label=\"Alert destinations\" value={destinations} onValueChange={setDestinations}>\n        <Checkbox value=\"Desk\" label=\"Desk\" />\n        <Checkbox value=\"Wrist relay\" label=\"Wrist relay\" />\n      </CheckboxGroup>\n      <Switch label=\"Quiet hours\" checked={quiet} onCheckedChange={setQuiet} />\n      <Select label=\"Test notification\" value={eventId} options={events}\n        onValueChange={value => { if (value) setEventId(value) }} />\n      <div className=\"sink-row\" role=\"status\">\n        <Badge tone={event.priority ? \"flag\" : \"mute\"}>{event.priority ? \"Priority\" : \"Routine\"}</Badge>\n        <span>{outcome}</span>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/recipes/notification-rules.tsx"
    }
  ],
  "categories": [
    "recipe",
    "communication"
  ],
  "type": "registry:component"
}
