import { ActionIcon, Anchor, Group, Skeleton, Stack, Text, } from "@mantine/core"; import { DeleteIcon, EditIcon, OperationIcon, } from "@wealthledger/icons"; import { EntryCard, LoadingSkeleton } from "@wealthledger/ui"; import { type FC } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router"; import { BankFeedback, bankOperationAppearance, } from "@/entities/bank-card"; import type { CardPageVm } from "./CardPage.vm"; import classes from "./CardPage.module.css"; type CardHistoryProps = Pick; // eslint-disable-next-line sonarjs/function-return-type -- React renders elements, lists and empty output. const CardHistory: FC = (props) => { const vm = props; const { t } = useTranslation(); if (vm.rows) { if (vm.rows.length > 0) { return vm.rows.map((row) => { const details = row.otherCard ? ( {t("bank.card")} ) : undefined; return (
)} color={row.color} details={details} icon={( )} initial={row.title.charAt(0)} metadata={row.metadata} title={row.title} tone={row.tone} value={row.value} valueLabel={t(`bank.kinds.${row.item.kind}`)} wrap />
); }); } return {t("bank.noOperations")}; } if (vm.history.error) { return ( ); } if (vm.history.loading) { return ( ); } return null; }; export { CardHistory };