import React, { useState } from 'react'; import { Typography, Flex} from 'antd'; import type { Transaction } from '@/types/payment'; import formatDate from '@/helper/util/formatDateTime'; const { Text, Title } = Typography; type PaymentCardProps = Omit const PaymentCard: React.FC = ({ name, created_at, amount }: PaymentCardProps) => { const sign = (amount > 0) ? "+" : "-"; return ( {name} {formatDate(created_at)} 0) ? '!text-green-700' : '!text-red-700'} `}> {`${sign} RM ${Math.abs(amount).toFixed(2)}`} ) } export default PaymentCard;