{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "service-appointment",
  "title": "Service Appointment",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/service-appointment/ServiceAppointment.tsx",
      "content": "import { View, type ViewProps } from 'react-native'\nimport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogTrigger,\n} from '@/components/ui/alert-dialog'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nexport type ServiceAppointmentStatus = 'scheduled' | 'cancelled'\n\ninterface ServiceAppointmentLabels {\n  scheduled: string\n  cancelled: string\n  provider: string\n  when: string\n  where: string\n  reschedule: string\n  cancel: string\n  cancelTitle: string\n  cancelDescription: string\n  keep: string\n  confirmCancel: string\n  retry: string\n  bookAgain: string\n}\n\nexport interface ServiceAppointmentProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  service: string\n  provider?: string\n  /** Localized date and time, including a time zone when relevant. */\n  dateTime: string\n  location?: string\n  status?: ServiceAppointmentStatus\n  pending?: 'reschedule' | 'cancel'\n  error?: string\n  labels?: Partial<ServiceAppointmentLabels>\n  onReschedule?: () => void\n  onCancel?: () => void\n  onRetry?: () => void\n  onBookAgain?: () => void\n}\n\nexport function ServiceAppointment({\n  className,\n  service,\n  provider,\n  dateTime,\n  location,\n  status = 'scheduled',\n  pending,\n  error,\n  labels,\n  onReschedule,\n  onCancel,\n  onRetry,\n  onBookAgain,\n  ...props\n}: ServiceAppointmentProps) {\n  const cancelled = status === 'cancelled'\n  const visibleError = cancelled ? undefined : error\n  const statusLabel = cancelled ? (labels?.cancelled ?? 'Cancelled') : (labels?.scheduled ?? 'Scheduled')\n  useAnnouncement(visibleError ?? `${service}. ${statusLabel}. ${dateTime}`)\n\n  return (\n    <View {...props} className={cn('gap-[16px] rounded-lg border border-border bg-card p-[16px]', className)}>\n      <View className=\"gap-[8px]\">\n        <View className=\"items-start\">\n          <Badge variant={cancelled ? 'secondary' : 'success'}>{statusLabel}</Badge>\n        </View>\n        <Text size=\"title\" accessibilityRole=\"header\" className=\"text-card-foreground\">\n          {service}\n        </Text>\n      </View>\n      <View className=\"gap-[12px]\">\n        {provider ? (\n          <View className=\"gap-[4px]\">\n            <Text size=\"sm\" variant=\"muted\">\n              {labels?.provider ?? 'Provider'}\n            </Text>\n            <Text className=\"text-card-foreground\">{provider}</Text>\n          </View>\n        ) : null}\n        <View className=\"gap-[4px]\">\n          <Text size=\"sm\" variant=\"muted\">\n            {labels?.when ?? 'When'}\n          </Text>\n          <Text className=\"text-card-foreground\">{dateTime}</Text>\n        </View>\n        {location ? (\n          <View className=\"gap-[4px]\">\n            <Text size=\"sm\" variant=\"muted\">\n              {labels?.where ?? 'Where'}\n            </Text>\n            <Text className=\"text-card-foreground\">{location}</Text>\n          </View>\n        ) : null}\n      </View>\n      {visibleError ? (\n        <View className=\"gap-[8px] border-t border-border pt-[12px]\">\n          <Text size=\"sm\" accessibilityRole=\"alert\" className=\"text-destructive\">\n            {visibleError}\n          </Text>\n          {onRetry ? (\n            <Button\n              variant=\"outline\"\n              accessibilityLabel={labels?.retry ?? 'Try again'}\n              disabled={Boolean(pending)}\n              onPress={() => {\n                if (!pending) onRetry()\n              }}\n            >\n              {labels?.retry ?? 'Try again'}\n            </Button>\n          ) : null}\n        </View>\n      ) : null}\n      {cancelled ? (\n        onBookAgain ? (\n          <Button accessibilityLabel={labels?.bookAgain ?? 'Book another appointment'} onPress={onBookAgain}>\n            {labels?.bookAgain ?? 'Book another appointment'}\n          </Button>\n        ) : null\n      ) : onReschedule || onCancel ? (\n        <View className=\"gap-[8px]\">\n          {onReschedule ? (\n            <Button\n              variant=\"outline\"\n              accessibilityLabel={labels?.reschedule ?? 'Reschedule'}\n              disabled={pending === 'cancel'}\n              loading={pending === 'reschedule'}\n              onPress={() => {\n                if (!pending) onReschedule()\n              }}\n            >\n              {labels?.reschedule ?? 'Reschedule'}\n            </Button>\n          ) : null}\n          {onCancel ? (\n            <AlertDialog>\n              <AlertDialogTrigger\n                variant=\"ghost\"\n                accessibilityLabel={labels?.cancel ?? 'Cancel appointment'}\n                loading={pending === 'cancel'}\n                disabled={pending === 'reschedule'}\n              >\n                {labels?.cancel ?? 'Cancel appointment'}\n              </AlertDialogTrigger>\n              <AlertDialogContent\n                title={labels?.cancelTitle ?? 'Cancel this appointment?'}\n                description={labels?.cancelDescription ?? 'Your reserved time will be released.'}\n              >\n                <AlertDialogCancel variant=\"outline\" accessibilityLabel={labels?.keep ?? 'Keep appointment'}>\n                  {labels?.keep ?? 'Keep appointment'}\n                </AlertDialogCancel>\n                <AlertDialogAction\n                  variant=\"destructive\"\n                  accessibilityLabel={labels?.confirmCancel ?? 'Confirm cancellation'}\n                  disabled={Boolean(pending)}\n                  onPress={() => {\n                    if (!pending) onCancel()\n                  }}\n                >\n                  {labels?.confirmCancel ?? 'Confirm cancellation'}\n                </AlertDialogAction>\n              </AlertDialogContent>\n            </AlertDialog>\n          ) : null}\n        </View>\n      ) : null}\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/service-appointment/ServiceAppointment.tsx"
    },
    {
      "path": "packages/registry-native/blocks/service-appointment/index.ts",
      "content": "export { ServiceAppointment, type ServiceAppointmentProps, type ServiceAppointmentStatus } from './ServiceAppointment'\n",
      "type": "registry:block",
      "target": "~/components/blocks/service-appointment/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/alert-dialog.json",
    "https://native.uipkge.dev/r/native/badge.json",
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Appointment summary with rescheduling, cancellation confirmation, and recovery actions supplied by the caller.",
  "categories": [
    "reservation"
  ]
}