{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "send-money-base",
  "type": "registry:component",
  "title": "Send Money (base)",
  "description": "Theme-ready base variant of Quick send money interaction with confirmation, status, and feedback states..",
  "dependencies": [
    "lucide-react",
    "motion",
    "react-icons"
  ],
  "files": [
    {
      "path": "components/watermelon/send-money.tsx",
      "type": "registry:component",
      "content": "'use client';\n\nimport React, { useState } from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { Building2, CreditCard, Wallet, X } from 'lucide-react';\nimport { MdOutlineAddCard } from 'react-icons/md';\n\nexport type PaymentType = 'bank' | 'card' | 'wallet' | null;\n\nexport interface Card {\n  id: string;\n  last4: string;\n  brand: 'visa' | 'mastercard' | 'other';\n}\n\ninterface SendMoneyProps {\n  cards?: Card[];\n  onProceed?: (data: any) => void;\n}\n\n/* ---------------- Brand Icons ---------------- */\n\nconst VisaIcon = () => (\n  <span className=\"text-foreground text-sm font-semibold italic\">VISA</span>\n);\n\nconst MasterCardIcon = () => (\n  <div className=\"flex -space-x-2\">\n    <div className=\"bg-destructive h-4 w-4 rounded-lg\" />\n    <div className=\"bg-primary h-4 w-4 rounded-lg\" />\n  </div>\n);\n\n/* ---------------- Shared UI ---------------- */\n\nconst cardContainer =\n  'rounded-2xl border transition-colors bg-muted border-border';\n\nconst primaryButton =\n  'h-11 w-full rounded-2xl font-medium bg-primary text-primary-foreground';\n\nconst Header = ({\n  title,\n  icon: Icon,\n  onClose,\n  id,\n}: {\n  title: string;\n  icon: any;\n  onClose: () => void;\n  id: string;\n}) => (\n  <div className=\"mb-6 flex items-center justify-between gap-3\">\n    <div className=\"flex min-w-0 items-center gap-3\">\n      <motion.div\n        layoutId={`icon-${id}`}\n        transition={{ type: 'spring', bounce: 0.3, duration: 0.7 }}\n        className=\"border-border bg-muted text-muted-foreground flex h-11 w-11 shrink-0 items-center justify-center rounded-lg border\"\n      >\n        <Icon size={22} strokeWidth={1.4} />\n      </motion.div>\n      <motion.h2\n        layoutId={`title-${id}`}\n        transition={{ type: 'spring', bounce: 0.3, duration: 0.7 }}\n        className=\"truncate text-base font-medium\"\n      >\n        {title}\n      </motion.h2>\n    </div>\n\n    <button\n      onClick={onClose}\n      className=\"bg-muted text-muted-foreground flex h-9 w-9 shrink-0 items-center justify-center rounded-lg\"\n    >\n      <X size={20} strokeWidth={3} />\n    </button>\n  </div>\n);\n\nconst InputField = ({ label, value, onChange }: any) => (\n  <div className=\"mb-4\">\n    <label className=\"text-muted-foreground mb-1 block text-sm\">{label}</label>\n    <input\n      value={value}\n      onChange={(e) => onChange(e.target.value)}\n      className=\"border-border bg-background focus:border-primary text-foreground h-12 w-full rounded-lg border px-4 transition focus:outline-none\"\n    />\n  </div>\n);\n\n/* ---------------- Views ---------------- */\n\nconst BankTransferView = ({ onClose, onProceed }: any) => {\n  const [formData, setFormData] = useState({ name: '', account: '', code: '' });\n\n  return (\n    <motion.div layout>\n      <Header\n        title=\"Bank Transfer\"\n        icon={Building2}\n        onClose={onClose}\n        id=\"bank\"\n      />\n      <motion.div\n        initial={{ opacity: 0, filter: 'blur(4px)', y: 20 }}\n        animate={{ opacity: 1, filter: 'blur(0px)', y: 0 }}\n        exit={{ opacity: 0, filter: 'blur(4px)', y: -20 }}\n        transition={{ type: 'spring', bounce: 0.4, duration: 0.7 }}\n      >\n        <InputField\n          label=\"Full Name\"\n          value={formData.name}\n          onChange={(v: string) => setFormData({ ...formData, name: v })}\n        />\n        <InputField\n          label=\"Account Number\"\n          value={formData.account}\n          onChange={(v: string) => setFormData({ ...formData, account: v })}\n        />\n        <InputField\n          label=\"Bank Code\"\n          value={formData.code}\n          onChange={(v: string) => setFormData({ ...formData, code: v })}\n        />\n        <button\n          onClick={() => onProceed({ type: 'bank', ...formData })}\n          className={`mt-5 ${primaryButton}`}\n        >\n          Proceed\n        </button>\n      </motion.div>\n    </motion.div>\n  );\n};\n\nconst CardView = ({ cards, onClose, onProceed }: any) => {\n  const [selected, setSelected] = useState(cards[0]?.id);\n\n  return (\n    <motion.div>\n      <Header\n        title=\"Debit/Credit Card\"\n        icon={CreditCard}\n        onClose={onClose}\n        id=\"card\"\n      />\n\n      <motion.div\n        initial={{ opacity: 0, filter: 'blur(4px)', y: 20 }}\n        animate={{ opacity: 1, filter: 'blur(0px)', y: 0 }}\n        exit={{ opacity: 0, filter: 'blur(4px)', y: -20 }}\n        transition={{ type: 'spring', bounce: 0.4, duration: 0.7 }}\n      >\n        <div className=\"mb-4 flex flex-wrap items-center justify-between gap-2\">\n          <span className=\"text-muted-foreground text-sm\">Available Cards</span>\n          <button className=\"border-border text-muted-foreground flex items-center gap-2 rounded-lg border px-3 py-1 text-sm\">\n            <MdOutlineAddCard size={18} />\n            Add Card\n          </button>\n        </div>\n\n        <div className=\"mb-6 space-y-3\">\n          {cards.map((card: Card) => (\n            <label\n              key={card.id}\n              onClick={() => setSelected(card.id)}\n              className={`flex h-14 cursor-pointer items-center justify-between rounded-lg border px-4 transition ${\n                selected === card.id\n                  ? 'border-primary bg-accent'\n                  : cardContainer\n              }`}\n            >\n              <div className=\"flex items-center gap-3\">\n                <div\n                  className={`flex h-5 w-5 items-center justify-center rounded-lg border-2 ${\n                    selected === card.id\n                      ? 'border-primary'\n                      : 'border-muted-foreground'\n                  }`}\n                >\n                  {selected === card.id && (\n                    <div className=\"bg-primary h-2.5 w-2.5 rounded-lg\" />\n                  )}\n                </div>\n\n                <span className=\"text-foreground font-medium\">\n                  •••• {card.last4}\n                </span>\n              </div>\n\n              {card.brand === 'visa' ? <VisaIcon /> : <MasterCardIcon />}\n            </label>\n          ))}\n        </div>\n\n        <button\n          onClick={() => onProceed({ type: 'card', cardId: selected })}\n          className={primaryButton}\n        >\n          Proceed\n        </button>\n      </motion.div>\n    </motion.div>\n  );\n};\n\nconst WalletView = ({ onClose, onProceed }: any) => {\n  const [amount, setAmount] = useState('');\n\n  return (\n    <motion.div>\n      <Header title=\"Wallet\" icon={Wallet} onClose={onClose} id=\"wallet\" />\n\n      <motion.div\n        initial={{ opacity: 0, filter: 'blur(4px)', y: 20 }}\n        animate={{ opacity: 1, filter: 'blur(0px)', y: 0 }}\n        exit={{ opacity: 0, filter: 'blur(4px)', y: -20 }}\n        transition={{ type: 'spring', bounce: 0.4, duration: 0.7 }}\n      >\n        <div className=\"border-border bg-muted mb-5 rounded-2xl border p-4\">\n          <p className=\"text-muted-foreground mb-1 text-sm\">Total Balance</p>\n          <h3 className=\"text-foreground text-2xl font-semibold\">$12,450.00</h3>\n        </div>\n\n        <InputField\n          label=\"Amount to Send\"\n          value={amount}\n          onChange={setAmount}\n        />\n\n        <button\n          onClick={() => onProceed({ type: 'wallet', amount })}\n          className={primaryButton}\n        >\n          Proceed\n        </button>\n      </motion.div>\n    </motion.div>\n  );\n};\n\n/* ---------------- Main ---------------- */\n\nexport const SendMoney: React.FC<SendMoneyProps> = ({\n  cards = [\n    { id: '1', last4: '6756', brand: 'visa' },\n    { id: '2', last4: '4632', brand: 'mastercard' },\n  ],\n  onProceed = () => {},\n}) => {\n  const [view, setView] = useState<PaymentType>(null);\n\n  return (\n    <div className=\"theme-injected flex min-h-[60vh] w-full items-center justify-center bg-transparent p-4\">\n      <motion.div\n        layout\n        className=\"border-border bg-background w-full max-w-[400px] rounded-lg border p-5 shadow-lg transition-all sm:p-6\"\n      >\n        <AnimatePresence mode=\"wait\">\n          {!view ? (\n            <motion.div>\n              <motion.h1\n                initial={{ opacity: 0, filter: 'blur(4px)' }}\n                animate={{ opacity: 1, filter: 'blur(0px)' }}\n                exit={{ opacity: 0, filter: 'blur(4px)' }}\n                transition={{ type: 'spring', bounce: 0.3, duration: 0.7 }}\n                className=\"text-muted-foreground mb-6 text-base\"\n              >\n                Send Money\n              </motion.h1>\n\n              <div className=\"space-y-2\">\n                {[\n                  {\n                    id: 'bank',\n                    title: 'Bank Transfer',\n                    sub: 'Transfer to bank account',\n                    icon: Building2,\n                  },\n                  {\n                    id: 'card',\n                    title: 'Debit/Credit Card',\n                    sub: 'Send money from your card',\n                    icon: CreditCard,\n                  },\n                  {\n                    id: 'wallet',\n                    title: 'Wallet',\n                    sub: 'Transfer from your wallet',\n                    icon: Wallet,\n                  },\n                ].map((opt) => (\n                  <button\n                    key={opt.id}\n                    onClick={() => setView(opt.id as PaymentType)}\n                    className=\"hover:bg-accent/5 flex w-full items-center gap-3 rounded-lg p-3 transition sm:gap-4 sm:p-4\"\n                  >\n                    <motion.div\n                      layoutId={`icon-${opt.id}`}\n                      className=\"border-border bg-muted text-muted-foreground flex h-11 w-11 shrink-0 items-center justify-center rounded-lg border sm:h-12 sm:w-12\"\n                    >\n                      <opt.icon size={22} className=\"sm:size-6\" />\n                    </motion.div>\n                    <div className=\"text-left\">\n                      <motion.p\n                        layoutId={`title-${opt.id}`}\n                        className=\"text-foreground font-medium\"\n                      >\n                        {opt.title}\n                      </motion.p>\n                      <p className=\"text-muted-foreground text-sm\">{opt.sub}</p>\n                    </div>\n                  </button>\n                ))}\n              </div>\n            </motion.div>\n          ) : (\n            <>\n              {view === 'bank' && (\n                <BankTransferView\n                  onClose={() => setView(null)}\n                  onProceed={onProceed}\n                />\n              )}\n              {view === 'card' && (\n                <CardView\n                  cards={cards}\n                  onClose={() => setView(null)}\n                  onProceed={onProceed}\n                />\n              )}\n              {view === 'wallet' && (\n                <WalletView\n                  onClose={() => setView(null)}\n                  onProceed={onProceed}\n                />\n              )}\n            </>\n          )}\n        </AnimatePresence>\n      </motion.div>\n    </div>\n  );\n};\n"
    }
  ]
}
