import { MaterialCommunityIcons } from "@expo/vector-icons"; import { Text, TouchableOpacity, View } from "react-native"; import ReactNativeModal from "react-native-modal"; import { useT } from "@/lib/i18n"; // How the rider pays, asked at the moment it becomes a real question: after // they have chosen a driver, not before they know one exists. // // The card path opens the gateway's hosted page and can take the better part // of a minute, during which the driver they picked could be taken by someone // else — so the sheet says what happens either way rather than dropping the // rider into a browser with no warning. type Props = { visible: boolean; driverName: string | null; fareCents: number; submitting: boolean; onPay: (method: "cash" | "card") => void; onCancel: () => void; }; export const PaymentChoiceSheet = ({ visible, driverName, fareCents, submitting, onPay, onCancel, }: Props) => { const t = useT(); const fare = (fareCents / 100).toFixed(2); return ( {driverName ? t("bookRide.payment.titleNamed", { name: driverName }) : t("bookRide.payment.title")} {t("bookRide.payment.subtitle", { fare })} onPay("cash")} disabled={submitting} className="flex-row items-center gap-x-3 rounded-2xl border border-neutral-200 dark:border-neutral-700 px-4 py-4 mt-4" > {t("bookRide.payment.cash")} {t("bookRide.payment.cashHint")} onPay("card")} disabled={submitting} className="flex-row items-center gap-x-3 rounded-2xl border border-neutral-200 dark:border-neutral-700 px-4 py-4 mt-2" > {t("bookRide.payment.card")} {t("bookRide.payment.cardHint")} {submitting ? t("bookRide.payment.working") : t("common.cancel")} ); };