import { Alert, Button, Group, Loader, Stack, Text } from "@mantine/core"; import type { FC } from "react"; import { useTranslation } from "react-i18next"; import { formatSnapshotTime } from "@/shared/lib"; type AccountsRefreshStateProps = { lastSuccessfulAt?: string | null; sourceError?: boolean; refreshing?: boolean; refreshError?: boolean; retry?: () => void; }; const AccountsRefreshState: FC = (props) => { const { refreshing = false, refreshError = false, retry } = props; const { t } = useTranslation(); return ( <> {props.lastSuccessfulAt ? ( {t("investment.sourceTime", { date: formatSnapshotTime(props.lastSuccessfulAt), })} ) : null} {refreshing ? ( {t("accounts.refreshing")} ) : null} {refreshError ? ( {t( props.sourceError ? "investment.syncFailed" : "accounts.refreshError", )} ) : null} ); }; export { AccountsRefreshState, type AccountsRefreshStateProps };