{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "transfer-review",
  "title": "Transfer Review",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/transfer-review/TransferReview.tsx",
      "content": "import * as React from 'react'\nimport { View, type ViewProps } from 'react-native'\nimport { Alert, AlertDescription } from '@/components/ui/alert'\nimport { Button, type ButtonProps } from '@/components/ui/button'\nimport { Separator } from '@/components/ui/separator'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nconst defaultLabels = {\n  recipient: 'Recipient',\n  amount: 'Recipient receives',\n  fee: 'Transfer fee',\n  total: 'Total you pay',\n  arrival: 'Expected arrival',\n  unavailable: 'Unavailable',\n  edit: 'Edit transfer',\n  confirm: 'Confirm transfer',\n  confirming: 'Confirming…',\n}\n\nexport interface TransferReviewProps extends ViewProps {\n  className?: string\n  recipient: string\n  /** A non-sensitive identifier, such as an account suffix. */\n  recipientDetail?: string\n  /** Localized values from the caller's quote. */\n  amount: string\n  fee: string\n  total: string\n  arrival: string\n  busy?: boolean\n  /** A quote error blocks Confirm while leaving Edit available. */\n  error?: string\n  labels?: Partial<typeof defaultLabels>\n  /** Compose TransferReviewEdit to inherit the busy state. */\n  editAction?: React.ReactNode\n  /** Compose TransferReviewConfirm to inherit quote validity and the busy state. */\n  confirmAction?: React.ReactNode\n}\n\nconst ReviewContext = React.createContext<{\n  busy: boolean\n  canConfirm: boolean\n  copy: typeof defaultLabels\n} | null>(null)\n\nexport function TransferReview({\n  className,\n  recipient,\n  recipientDetail,\n  amount,\n  fee,\n  total,\n  arrival,\n  busy = false,\n  error,\n  labels,\n  editAction,\n  confirmAction,\n  ...props\n}: TransferReviewProps) {\n  const copy = { ...defaultLabels, ...labels }\n  const hasQuote = [recipient, amount, fee, total, arrival].every((value) => value.trim().length > 0)\n  const canConfirm = hasQuote && !error && !busy\n  useAnnouncement(error && !busy ? error : undefined)\n\n  return (\n    <ReviewContext.Provider value={{ busy, canConfirm, copy }}>\n      <View {...props} className={cn('gap-4', className)}>\n        <View className=\"gap-4 rounded-2xl border border-border bg-card p-5\">\n          <View className=\"gap-1\">\n            <Text size=\"sm\" variant=\"muted\">\n              {copy.recipient}\n            </Text>\n            <Text size=\"lg\" className=\"font-semibold\">\n              {recipient.trim() || copy.unavailable}\n            </Text>\n            {recipientDetail ? (\n              <Text size=\"sm\" variant=\"muted\">\n                {recipientDetail}\n              </Text>\n            ) : null}\n          </View>\n          <Separator />\n          <View className=\"gap-1\">\n            <Text size=\"sm\" variant=\"muted\">\n              {copy.amount}\n            </Text>\n            <Text size=\"title\" style={{ fontVariant: ['tabular-nums'] }}>\n              {amount.trim() || copy.unavailable}\n            </Text>\n          </View>\n        </View>\n        <View className=\"gap-3 rounded-2xl border border-border bg-card p-4\">\n          <View className=\"flex-row flex-wrap items-baseline justify-between gap-x-4 gap-y-1\">\n            <Text size=\"sm\" variant=\"muted\">\n              {copy.fee}\n            </Text>\n            <Text size=\"sm\" style={{ fontVariant: ['tabular-nums'] }}>\n              {fee.trim() || copy.unavailable}\n            </Text>\n          </View>\n          <View className=\"flex-row flex-wrap items-baseline justify-between gap-x-4 gap-y-1\">\n            <Text size=\"sm\" variant=\"muted\">\n              {copy.arrival}\n            </Text>\n            <Text size=\"sm\" className=\"shrink\">\n              {arrival.trim() || copy.unavailable}\n            </Text>\n          </View>\n          <Separator />\n          <View className=\"flex-row flex-wrap items-baseline justify-between gap-x-4 gap-y-1\">\n            <Text className=\"font-semibold\">{copy.total}</Text>\n            <Text className=\"font-semibold\" style={{ fontVariant: ['tabular-nums'] }}>\n              {total.trim() || copy.unavailable}\n            </Text>\n          </View>\n        </View>\n        {error && !busy ? (\n          <Alert variant=\"destructive\">\n            <AlertDescription>{error}</AlertDescription>\n          </Alert>\n        ) : null}\n        {confirmAction || editAction ? (\n          <View className=\"gap-2\">\n            {confirmAction}\n            {editAction}\n          </View>\n        ) : null}\n      </View>\n    </ReviewContext.Provider>\n  )\n}\n\nexport interface TransferReviewActionProps extends Omit<ButtonProps, 'children' | 'loading' | 'onPress'> {\n  label?: string\n  onPress: NonNullable<ButtonProps['onPress']>\n}\n\nfunction ReviewAction({\n  kind,\n  label,\n  disabled,\n  accessibilityLabel,\n  onPress,\n  ...props\n}: TransferReviewActionProps & { kind: 'confirm' | 'edit' }) {\n  const review = React.useContext(ReviewContext)\n  if (!review) throw new Error('Transfer review actions must be inside TransferReview')\n  const confirmed = kind === 'confirm'\n  const blocked = !!disabled || (confirmed ? !review.canConfirm : review.busy)\n  const loading = confirmed && review.busy\n  const text = loading ? review.copy.confirming : (label ?? (confirmed ? review.copy.confirm : review.copy.edit))\n\n  return (\n    <Button\n      variant={confirmed ? 'default' : 'outline'}\n      {...props}\n      disabled={blocked && !loading}\n      loading={loading}\n      accessibilityLabel={loading ? text : (accessibilityLabel ?? text)}\n      onPress={(event) => {\n        if (!blocked) onPress(event)\n      }}\n    >\n      {text}\n    </Button>\n  )\n}\n\nexport function TransferReviewEdit(props: TransferReviewActionProps) {\n  return <ReviewAction kind=\"edit\" {...props} />\n}\n\nexport function TransferReviewConfirm(props: TransferReviewActionProps) {\n  return <ReviewAction kind=\"confirm\" {...props} />\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/transfer-review/TransferReview.tsx"
    },
    {
      "path": "packages/registry-native/blocks/transfer-review/index.ts",
      "content": "export {\n  TransferReview,\n  TransferReviewConfirm,\n  TransferReviewEdit,\n  type TransferReviewActionProps,\n  type TransferReviewProps,\n} from './TransferReview'\n",
      "type": "registry:block",
      "target": "~/components/blocks/transfer-review/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/alert.json",
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/separator.json",
    "https://native.uipkge.dev/r/native/text.json"
  ],
  "description": "A controlled review of recipient, quoted amounts, fees, arrival, and transfer actions with busy and error states.",
  "categories": [
    "finance"
  ]
}