import type { FC } from "react"; import { Alert, Button, Group, Loader, Stack, Text, Title, } from "@mantine/core"; import { StateView } from "@wealthledger/ui"; import { FormProvider } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { formatSnapshotTime } from "@/shared/lib"; import type { AccountIncomePageViewModel } from "../AccountIncomePage.vm"; import classes from "../AccountIncomePage.module.css"; import { IncomeComparisons } from "./IncomeComparisons.view"; import { IncomePayments } from "./IncomePayments.view"; import { IncomePeriodForm } from "./IncomePeriodForm/IncomePeriodForm.view"; import { IncomeSummary } from "./IncomeSummary.view"; type LoadedProps = Extract; const AccountIncomePageLoadedSummary: FC = (props) => { const { t } = useTranslation(); const { analytics } = props; if (props.partial) { return {t("investment.partial")}; } return analytics.totalsByCurrency.length > 0 ? : ; }; const AccountIncomePageLoaded: FC = (props) => { const { display, form, onReset, onSubmit, refreshError, refreshing, retry } = props; const { t } = useTranslation(); return ( {!!props.lastSuccessfulAt && ( {t("investment.sourceTime", { date: formatSnapshotTime(props.lastSuccessfulAt), })} )} {t("income.title")} {!!refreshing && ( {t("income.refreshing")} )} {!!refreshError && ( {t( props.sourceError ? "investment.syncFailed" : "income.refreshError", )} )} {t("income.taxBoundary")} ); }; export { AccountIncomePageLoaded };