import type { FC, PropsWithChildren, ReactNode } from "react"; import { Paper, Stack, Text, VisuallyHidden } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { formatMoney } from "@/shared/lib"; import classes from "./EntryGroup.module.css"; type AccountRowProps = { accountName: string; value: string; valueLabel: string; }; type EntryGroupProps = PropsWithChildren<{ header: ReactNode; label: string; }>; type EntryGroupTotalProps = { isSigned?: boolean; totals: null | { currency: string; value: string }[]; }; const AccountRow: FC = (props) => { const accessibleName = `${props.accountName}, ${props.value}`; return (
  • {props.accountName} {props.value} {props.valueLabel}
  • ); }; const AccountCardRow: FC = props => (
  • {props.accountName} {props.value} {props.valueLabel}
  • ); const EntryGroup: FC = props => ( {props.header} {props.children} ); const EntryGroupTotal: FC = (props) => { const { t } = useTranslation(); if (!props.totals) { return {t("entryGroup.totalUnavailable")}; } const isSigned = props.isSigned === true; return ( {props.totals.map(total => ( {formatMoney(total, { withSign: isSigned || undefined })} ))} ); }; export { AccountCardRow, AccountRow, EntryGroup, EntryGroupTotal, };