import { FC } from "react"; import { formatYearMonth } from "../lib/format"; import { YearMonth } from "../lib/db-types"; import { formatCurrency } from "../lib/formatStrings"; export interface MonthCardProps { yearMonth: YearMonth, children?: React.ReactNode, monthlyExpense:number } export const MonthCard:FC = ({ yearMonth, children, monthlyExpense }) =>
{`${formatYearMonth(yearMonth)}`} { monthlyExpense>0 ?

Total monthly expenditure: { formatCurrency(monthlyExpense) }

: null }
{children}