{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "elements-schedule-card",
  "type": "registry:component",
  "title": "Schedule",
  "description": "A run that repeats on its own, with its cadence and how it has been doing.",
  "registryDependencies": [
    "https://r.assistant-ui.com/elements-surfaces.json"
  ],
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "type": "registry:component",
      "path": "components/assistant-ui/elements/schedule-card.tsx",
      "sourcePath": "packages/ui/src/components/react/assistant-ui/elements/schedule-card.tsx",
      "content": "\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { CheckIcon, ClockIcon, XIcon } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { field, mono, paper } from \"./surfaces\";\n\nexport interface ScheduleRun {\n  id: string;\n  at: string;\n  ok: boolean;\n}\n\nexport function ScheduleCard({\n  name,\n  cadence,\n  nextRun,\n  enabled,\n  history,\n  onToggle,\n  className,\n  ...props\n}: Omit<\n  ComponentProps<\"div\">,\n  | \"children\"\n  | \"name\"\n  | \"cadence\"\n  | \"nextRun\"\n  | \"enabled\"\n  | \"history\"\n  | \"onToggle\"\n> & {\n  name: string;\n  cadence: string;\n  nextRun: string;\n  enabled: boolean;\n  history: readonly ScheduleRun[];\n  onToggle?: () => void;\n}) {\n  return (\n    <div\n      data-slot=\"schedule-card\"\n      className={cn(\n        paper,\n        \"flex w-full max-w-sm flex-col gap-3 rounded-2xl p-4\",\n        className,\n      )}\n\n      {...props}\n    >\n      <div className=\"flex items-center gap-2.5\">\n        <span className=\"bg-foreground/[0.05] text-foreground/45 flex size-7 shrink-0 items-center justify-center rounded-lg\">\n          <ClockIcon className=\"size-3.5\" />\n        </span>\n        <div className=\"flex min-w-0 flex-1 flex-col\">\n          <span className=\"truncate text-[13.5px] font-medium\">{name}</span>\n          <span className={cn(mono, \"text-foreground/30\")}>{cadence}</span>\n        </div>\n        <button\n          type=\"button\"\n          role=\"switch\"\n          aria-checked={enabled}\n          aria-label={`${enabled ? \"Pause\" : \"Resume\"} ${name}`}\n          onClick={onToggle}\n          className={cn(\n            \"flex h-5 w-9 shrink-0 items-center rounded-full p-0.5 transition-colors duration-200\",\n            enabled ? \"bg-foreground/80\" : \"bg-foreground/15\",\n          )}\n        >\n          <span\n            className={cn(\n              \"bg-background size-4 rounded-full transition-transform duration-200 motion-reduce:transition-none\",\n              enabled && \"translate-x-4\",\n            )}\n          />\n        </button>\n      </div>\n\n      <div\n        className={cn(\n          field,\n          \"flex items-baseline gap-2 rounded-xl px-3 py-2\",\n          !enabled && \"opacity-45\",\n        )}\n      >\n        <span className={cn(mono, \"text-foreground/30\")}>next</span>\n        <span className=\"text-foreground/80 text-[13px]\">\n          {enabled ? nextRun : \"paused\"}\n        </span>\n      </div>\n\n      <div className=\"flex flex-col gap-1\">\n        <span className={cn(mono, \"text-foreground/30\")}>recent runs</span>\n        {history.map((run) => (\n          <div key={run.id} className=\"flex items-baseline gap-2\">\n            {run.ok ? (\n              <CheckIcon className=\"size-3 shrink-0 translate-y-0.5 text-emerald-500\" />\n            ) : (\n              <XIcon className=\"size-3 shrink-0 translate-y-0.5 text-red-500\" />\n            )}\n            <span className=\"text-foreground/60 min-w-0 flex-1 truncate text-xs\">\n              {run.at}\n            </span>\n            <span className={cn(mono, \"text-foreground/25 shrink-0\")}>\n              {run.ok ? \"ok\" : \"failed\"}\n            </span>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}