From 23fe9c97b0547c9ef20836cacfabe2cc9b446a95 Mon Sep 17 00:00:00 2001 From: G Date: Tue, 28 May 2024 17:03:47 +0000 Subject: [PATCH] take props now to render the provided data --- src/components/TransactionInformationsItem.tsx | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/components/TransactionInformationsItem.tsx b/src/components/TransactionInformationsItem.tsx index 8657439..4263605 100644 --- a/src/components/TransactionInformationsItem.tsx +++ b/src/components/TransactionInformationsItem.tsx @@ -1,6 +1,5 @@ import type { PaymentCode } from "@/utils/requests/Types"; -import { images } from "@styles/Commons"; -import { Image } from "react-native"; +import PaymentOption from "./PaymentOption"; import Box from "./bases/Box"; import Text from "./bases/Text"; @@ -9,10 +8,10 @@ interface Props { reference: string; date: string; amount: number; - status: "success" | "pending" | "failed" | "canceled"; + status: "SUCCESS" | "INITIATED" | "FAILED"; } -const TransactionInformationsItem = () => { +const TransactionInformationsItem = ({ paymentType, reference, date, amount, status }: Props) => { return ( { borderColor={"lightGray"} > - + /> */} + {}} /> - Reference - 12 Janvier 2099 + {reference} + {date} - - 7,000,000 - + {/* + {amount} + */} + ); }; +const AmountColorRenderer = ({ status, amount }: { status: string; amount: number }) => { + if (status === "SUCCESS") { + return ( + + {amount} + + ); + } + if (status === "INITIATED") { + return ( + + {amount} + + ); + } + return ( + + {amount} + + ); +}; + export default TransactionInformationsItem; -- libgit2 0.27.1