import type { FC } from "react";
import {
Alert,
Button,
Group,
MultiSelect,
Stack,
Title,
} from "@mantine/core";
import { DatePickerInput } from "@mantine/dates";
import { StateView } from "@wealthledger/ui";
import { useTranslation } from "react-i18next";
import { LedgerEntryRow, operationCategories } from "@/entities/broker-operation";
import { SourceSyncStatus } from "@/shared/ui";
import type { AccountOperationsPageViewModel } from "../AccountOperationsPage.vm";
type AccountOperationsPageLoadedProps = Extract<
AccountOperationsPageViewModel,
{ state: "loaded" }
>;
const AccountOperationsPageLoadedOperations: FC<
AccountOperationsPageLoadedProps
> = (props) => { // eslint-disable-line sonarjs/function-return-type -- React renders elements and lists.
const { t } = useTranslation();
const { items } = props;
if (items.length > 0) {
return items.map(operation => (
));
}
if (props.partial) {
return;
}
return ;
};
const AccountOperationsPageLoaded: FC = (
props,
) => {
const { t } = useTranslation();
const categoryData = operationCategories.map(category => ({
label: t(`ledger.category.${category}`),
value: category,
}));
return (
{t("ledger.title")}
{!!props.partial && {t("investment.partial")}}
{!!props.historyLoading && {t("investment.history")}}
{!!(props.hasNext || props.hasPrevious) && (
)}
);
};
export { AccountOperationsPageLoaded };