import type { Ionicons } from "@expo/vector-icons"; import { Card } from "@/components/ui/Card"; import { OptionRow } from "@/components/ui/Field"; import { Text } from "@/components/ui/Text"; import type { PaymentMethod } from "@/lib/stores/locationStore"; import { colors } from "@/lib/theme"; import { View } from "react-native"; const META: Record< PaymentMethod, { title: string; hint: string; icon: keyof typeof Ionicons.glyphMap } > = { chapa: { title: "Chapa", hint: "Card / mobile money via Chapa", icon: "card-outline" }, arifpay: { title: "ArifPay", hint: "Local digital checkout", icon: "wallet-outline" }, telebirr: { title: "Telebirr", hint: "Ethio telecom Telebirr", icon: "phone-portrait-outline" }, mpesa: { title: "M-Pesa", hint: "Safaricom M-Pesa", icon: "cash-outline" }, bank: { title: "Bank transfer", hint: "Transfer + upload receipt later", icon: "business-outline" }, pay_at_branch: { title: "Pay at branch", hint: "Cash or POS when you collect", icon: "storefront-outline", }, cod: { title: "Cash on delivery", hint: "Pay the rider on arrival", icon: "bicycle-outline" }, }; export function PaymentMethodList({ methods, selected, onSelect, title = "Payment", footnote, }: { methods: PaymentMethod[]; selected: PaymentMethod; onSelect: (m: PaymentMethod) => void; title?: string; footnote?: string; }) { return ( {title} {footnote ? ( {footnote} ) : null} {methods.map((m, i) => ( onSelect(m)} icon={META[m].icon} last={i === methods.length - 1} /> ))} ); } export function paymentLabel(m: PaymentMethod) { return META[m]?.title ?? m; }