{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "booking-01",
  "type": "registry:block",
  "description": "Book a blood test: pick a date, a morning slot, and a clinic, then confirm.",
  "files": [
    {
      "path": "registry/predict/blocks/booking-01/page.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { CheckIcon, MapPinIcon } from \"lucide-react\"\n\nimport { Button } from \"@workspace/ui/components/button\"\nimport { Calendar } from \"@workspace/ui/components/calendar\"\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@workspace/ui/components/card\"\nimport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n  DialogTrigger,\n} from \"@workspace/ui/components/dialog\"\nimport { RadioGroup, RadioGroupItem } from \"@workspace/ui/components/radio-group\"\nimport { Separator } from \"@workspace/ui/components/separator\"\n\n// Blood draws need a fast, so only morning slots.\nconst slots = [\"07:00\", \"07:30\", \"08:00\", \"08:30\", \"09:00\", \"09:30\", \"10:00\", \"10:30\"]\n\nconst clinics = [\n  { value: \"andheri\", name: \"Andheri West\", address: \"Link Road, Mumbai\" },\n  { value: \"bandra\", name: \"Bandra\", address: \"Hill Road, Mumbai\" },\n  { value: \"home\", name: \"Home visit\", address: \"A phlebotomist comes to you\" },\n]\n\nfunction tomorrow() {\n  const date = new Date()\n  date.setDate(date.getDate() + 1)\n  return date\n}\n\nexport default function Page() {\n  const [date, setDate] = React.useState<Date | undefined>(tomorrow)\n  const [slot, setSlot] = React.useState(\"08:00\")\n  const [clinic, setClinic] = React.useState(\"andheri\")\n\n  const clinicName = clinics.find((c) => c.value === clinic)?.name\n  const dateLabel = date?.toLocaleDateString(undefined, {\n    weekday: \"long\",\n    day: \"numeric\",\n    month: \"long\",\n  })\n\n  return (\n    <div className=\"flex min-h-svh items-center justify-center p-4\">\n      <Card className=\"w-full max-w-3xl\">\n        <CardHeader>\n          <CardTitle className=\"text-base\">Book your blood test</CardTitle>\n          <CardDescription>Fast for 10 to 12 hours before your slot. Water is fine.</CardDescription>\n        </CardHeader>\n\n        <CardContent className=\"grid gap-6 md:grid-cols-[auto_1fr]\">\n          <Calendar\n            mode=\"single\"\n            selected={date}\n            onSelect={setDate}\n            disabled={{ before: tomorrow() }}\n            className=\"mx-auto rounded-lg border\"\n          />\n\n          <div className=\"flex flex-col gap-6\">\n            <div className=\"flex flex-col gap-2\">\n              <h2 id=\"slot-label\" className=\"text-xs font-medium\">Time</h2>\n              <RadioGroup\n                value={slot}\n                onValueChange={(value) => setSlot(value as string)}\n                aria-labelledby=\"slot-label\"\n                className=\"grid grid-cols-4 gap-2\"\n              >\n                {slots.map((time) => (\n                  <label\n                    key={time}\n                    className=\"flex cursor-pointer items-center justify-center rounded-full border py-2 text-xs tabular-nums has-data-checked:border-primary has-data-checked:bg-primary has-data-checked:text-primary-foreground\"\n                  >\n                    <RadioGroupItem value={time} className=\"sr-only\" />\n                    {time}\n                  </label>\n                ))}\n              </RadioGroup>\n            </div>\n\n            <div className=\"flex flex-col gap-2\">\n              <h2 id=\"clinic-label\" className=\"text-xs font-medium\">Where</h2>\n              <RadioGroup\n                value={clinic}\n                onValueChange={(value) => setClinic(value as string)}\n                aria-labelledby=\"clinic-label\"\n              >\n                {clinics.map((option) => (\n                  <label\n                    key={option.value}\n                    className=\"flex items-start gap-3 rounded-lg border p-3 has-data-checked:border-primary\"\n                  >\n                    <RadioGroupItem value={option.value} className=\"mt-0.5\" />\n                    <span className=\"grid gap-0.5\">\n                      <span className=\"text-sm font-medium\">{option.name}</span>\n                      <span className=\"text-xs text-muted-foreground\">{option.address}</span>\n                    </span>\n                  </label>\n                ))}\n              </RadioGroup>\n            </div>\n          </div>\n        </CardContent>\n\n        <Separator />\n\n        <CardFooter className=\"flex-col items-stretch gap-3 sm:flex-row sm:items-center sm:justify-between\">\n          <p className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n            <MapPinIcon className=\"size-3.5 shrink-0\" />\n            {date ? `${dateLabel} at ${slot}, ${clinicName}` : \"Pick a date\"}\n          </p>\n          <Dialog>\n            <DialogTrigger render={<Button disabled={!date} />}>Confirm booking</DialogTrigger>\n            <DialogContent showCloseButton={false}>\n              <DialogHeader>\n                <div className=\"mb-2 flex size-10 items-center justify-center rounded-full bg-status-normal/15 text-status-normal\">\n                  <CheckIcon className=\"size-5\" />\n                </div>\n                <DialogTitle>You're booked</DialogTitle>\n                <DialogDescription>\n                  {dateLabel} at {slot}, {clinicName}. We'll send a reminder the evening before.\n                </DialogDescription>\n              </DialogHeader>\n              <DialogFooter>\n                <DialogClose render={<Button />}>Done</DialogClose>\n              </DialogFooter>\n            </DialogContent>\n          </Dialog>\n        </CardFooter>\n      </Card>\n    </div>\n  )\n}\n",
      "type": "registry:page",
      "target": "app/book/page.tsx"
    }
  ],
  "meta": {
    "iframeHeight": "820px"
  },
  "categories": [
    "booking"
  ]
}