/** * Renders a modal with information about a credit transaction. * @returns {JSX.Element} - The rendered modal component. */ function CompleteConfirmCredit({ onClose, confirmCredit }) { const { data } = confirmCredit; const isSuccess = data?.result === "Charge success" || data?.status === "successful"; return (
{isSuccess ? ( <> ) : ( <> )}

{isSuccess ? "Credit was Successful!" : "Credit was Unsuccessful"}

{data?.internal_return >= 0 && data?.result !== "Charge failed" && ( <>

Amount({data?.currency || ""})

{`${data?.symbol || ""} ${ Number(data?.amount * 0.01).toLocaleString() || "" }`}
{data?.curr_balance &&

Wallet Balance

{data?.curr_balance * 0.01}
} {isSuccess && (

Confirmation Number

{data?.confirmation}
)} )}
); } export default CompleteConfirmCredit;