import type { JSX } from 'react' import { formatNumberWithPeriods } from '~/utils/formatter' type CardReportProperty = { title: string amount: number currency?: string icon: ( properties: React.JSX.IntrinsicAttributes & React.SVGProps, ) => JSX.Element url?: string counter?: number[] } export const CardReport = (properties: CardReportProperty) => { const { title, amount, icon: Icon, counter, currency } = properties return (

{title}

{currency ? `${currency} ${formatNumberWithPeriods(amount)}` : formatNumberWithPeriods(amount)}

{counter?.length && (
Pribadi: {counter[0]} | Perusahaan: {counter[1]}
)}
) }