import type { FC } from "react"; import { Alert, Button, Group, Stack, Text, Title, } from "@mantine/core"; import { DatePickerInput } from "@mantine/dates"; import { useTranslation } from "react-i18next"; import { BrokerageEventCard, BrokerageEventGroup, brokerageEventGroupKey, brokerageEventKey, } from "@/entities/brokerage-event"; import { formatDate, formatSnapshotTime, groupItems } from "@/shared/lib"; import { ReadRetry, SourceSyncStatus } from "@/shared/ui"; import type { AccountEventsPageViewModel } from "../AccountEventsPage.vm"; import { AccountEventsPageEmpty } from "./AccountEventsPageEmpty.view"; type AccountEventsPageLoadedProps = Extract< AccountEventsPageViewModel, { state: "loaded" } >; const AccountEventsPageLoadedEvents: FC = ( props, ) => { if (props.events.length > 0) { const entries = groupItems( props.events, props.allAccounts ? brokerageEventGroupKey : () => null, ); return ( {entries.map(entry => entry.type === "group" ? ( ) : (
  • ))}
    ); } if (props.partial) { return; } return ; }; const AccountEventsPageLoaded: FC = (props) => { const { t } = useTranslation(); return ( {t("events.title")} {!!props.partial && {t("investment.partial")}} {t("events.hint")} {t("events.forecastWindow", { date: formatSnapshotTime(props.calculatedAt), from: formatDate(props.window.from), to: formatDate(props.window.to), })} ); }; export { AccountEventsPageLoaded };