Report Profit Loss
This commit is contained in:
@@ -4,7 +4,8 @@ import { Box, Typography, Paper } from '@mui/material'
|
||||
// Types
|
||||
type ReportItemHeaderProps = {
|
||||
title: string
|
||||
date: string
|
||||
date?: string
|
||||
amount?: number
|
||||
}
|
||||
|
||||
type ReportItemSubheaderProps = {
|
||||
@@ -34,14 +35,14 @@ const formatCurrency = (amount: number) => {
|
||||
}
|
||||
|
||||
// ReportItemHeader Component
|
||||
export const ReportItemHeader: React.FC<ReportItemHeaderProps> = ({ title, date }) => {
|
||||
export const ReportItemHeader: React.FC<ReportItemHeaderProps> = ({ title, date, amount }) => {
|
||||
return (
|
||||
<Box className='bg-slate-200 px-6 py-4 flex justify-between items-center'>
|
||||
<Typography variant='h6' className='text-primary font-semibold'>
|
||||
{title}
|
||||
</Typography>
|
||||
<Typography variant='body1' className='text-primary font-medium'>
|
||||
{date}
|
||||
{amount ? formatCurrency(amount) : date}
|
||||
</Typography>
|
||||
</Box>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user