import { ActionIcon, Button, Group, Paper, SimpleGrid, Skeleton, Stack, Switch, Text, Title, } from "@mantine/core"; import { AddIcon } from "@wealthledger/icons"; import { LoadingSkeleton, StateView } from "@wealthledger/ui"; import type { FC } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router"; import { BankCardFace, BankFeedback, BankPeriodPicker, BankSummaryView, } from "@/entities/bank-card"; import classes from "./CardsPage.module.css"; import type { CardsPageVm } from "./CardsPage.vm"; type CardsPageViewProps = { vm: CardsPageVm }; const CardsPageView: FC = (props) => { const { vm } = props; const { t } = useTranslation(); return ( {t("bank.title")} vm.setAdding(true)} > vm.setArchive(event.currentTarget.checked)} /> {vm.items ? ( vm.items.length ? ( {vm.items.map((card) => ( ))} ) : ( vm.setAdding(true)}> {t("bank.addCard")} } /> ) ) : vm.cards.isLoading ? ( ) : null} {vm.cards.isError && ( {t(vm.items ? "bank.refreshError" : "bank.error")} )} {vm.cards.data && vm.cards.isFetching && ( {t("bank.refreshing")} )} {Boolean(vm.categories.data?.length || vm.cards.data?.length) && ( )} void vm.summary.refetch()} /> {vm.categories.isError && ( void vm.categories.refetch()} /> )} ); }; export { CardsPageView };