import React from "react"; import { View, ScrollView } from "react-native"; import { useSirouRouter } from "@sirou/react-native"; import { useLocalSearchParams, Stack } from "expo-router"; import { AppRoutes } from "@/lib/routes"; import { Text } from "@/components/ui/text"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; import { ScreenWrapper } from "@/components/ScreenWrapper"; import { CheckCircle2, AlertCircle } from "@/lib/icons"; interface VerificationData { payerName: string; payerTelebirrNo: string; creditedPartyName: string; creditedPartyAccountNo: string; receiptNo: string; paymentDate: string; transactionStatus: string; totalPaidAmount: string; settledAmount: string; serviceFee: string; serviceFeeVAT: string; bankName: string; customerNote: string; } export default function VerifyPaymentResultScreen() { const nav = useSirouRouter(); const { data } = useLocalSearchParams<{ data: string }>(); let parsed: VerificationData | null = null; try { parsed = data ? JSON.parse(data) : null; } catch {} const d = parsed; const isCompleted = d?.transactionStatus === "Completed"; const rows: { label: string; value: string }[] = [ { label: "Payer", value: d?.payerName ?? "" }, { label: "Payer Number", value: d?.payerTelebirrNo ?? "" }, { label: "Credited Party", value: d?.creditedPartyName ?? "" }, { label: "Credited Account", value: d?.creditedPartyAccountNo ?? "" }, { label: "Receipt No", value: d?.receiptNo ?? "" }, { label: "Payment Date", value: d?.paymentDate ?? "" }, { label: "Status", value: d?.transactionStatus ?? "" }, { label: "Total Paid", value: d?.totalPaidAmount ?? "" }, { label: "Settled Amount", value: d?.settledAmount ?? "" }, { label: "Service Fee", value: d?.serviceFee ?? "" }, { label: "Service Fee VAT", value: d?.serviceFeeVAT ?? "" }, { label: "Bank", value: d?.bankName ?? "" }, { label: "Note", value: d?.customerNote ?? "" }, ].filter((r) => r.value); return ( {isCompleted ? ( ) : ( )} Payment Verification {isCompleted ? "Transaction completed" : (d?.transactionStatus ?? "Unknown status")} {rows.map((row, i) => ( {row.label} {row.value} ))} ); }