import type { PaymentCode } from "@/utils/requests/types"; import moment from "moment"; import "moment/locale/fr"; import PaymentOption from "./PaymentOption"; import Box from "./bases/Box"; import Text from "./bases/Text"; interface Props { paymentType: PaymentCode; reference: string; date: string; amount: number; status: "SUCCESS" | "INITIATED" | "FAILED"; } moment.locale("fr"); const TransactionInformationsItem = ({ paymentType, reference, date, amount, status }: Props) => { const dateObject = Date.parse(date); return ( {}} /> {reference} {moment(dateObject).fromNow()} ); }; const AmountColorRenderer = ({ status, amount }: { status: string; amount: number }) => { if (status === "SUCCESS") { return {amount}; } if (status === "INITIATED") { return {amount}; } return {amount}; }; const AmountWrapper = ({ color, children, }: { color: "secondary" | "softYellow" | "softRed"; children: React.ReactNode }) => { return ( {children} F ); }; export default TransactionInformationsItem;