import React from 'react' import { Box, Typography, Paper } from '@mui/material' // Types type ReportItemHeaderProps = { title: string date?: string amount?: number } type ReportItemSubheaderProps = { title: string } type ReportItemProps = { accountCode: string accountName: string amount: number onClick?: () => void isSubtitle?: boolean } type ReportItemFooterProps = { title: string amount: number children?: React.ReactNode } // Helper function to format currency const formatCurrency = (amount: number) => { return new Intl.NumberFormat('id-ID', { minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(amount) } // ReportItemHeader Component export const ReportItemHeader: React.FC = ({ title, date, amount }) => { return ( {title} {amount ? formatCurrency(amount) : date} ) } // ReportItemSubheader Component export const ReportItemSubheader: React.FC = ({ title }) => { return ( {title} ) } // ReportItem Component export const ReportItem: React.FC = ({ accountCode, accountName, amount, onClick, isSubtitle = true }) => { return ( {accountCode} {accountName} {formatCurrency(amount)} ) } // ReportItemFooter Component export const ReportItemFooter: React.FC = ({ title, amount, children }) => { return ( {title} {formatCurrency(amount)} {children && {children}} ) }