refactor: enforce frontend view model boundaries
Frontend verify / commits (pull_request) Successful in 28s
Frontend verify / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 8m19s

This commit is contained in:
2026-09-28 18:48:23 +03:00
parent 5b69003516
commit ca0ad4f824
287 changed files with 8558 additions and 4538 deletions
@@ -15,54 +15,61 @@ type RecentOperationsProps = {
};
const RecentOperations: FC<RecentOperationsProps> = (props) => {
const { operations } = props;
const { t } = useTranslation();
const { operations } = props;
return (
<Stack gap="sm">
{(operations.state === "loaded") && ((
{operations.state === "loaded" && (
<>
{!!(operations.lastSuccessfulAt) && ((
{!!operations.lastSuccessfulAt && (
<Text c="dimmed" size="xs">
{t("investment.sourceTime", {
date: formatSnapshotTime(operations.lastSuccessfulAt),
})}
</Text>
))}
{!!(operations.stale) && ((
<Text size="xs">{t("investment.stale")}</Text>
))}
{!!(operations.refreshError) && ((
)}
{!!operations.stale && <Text size="xs">{t("investment.stale")}</Text>}
{!!operations.refreshError && (
<Text role="status">{t("accounts.refreshError")}</Text>
))}
)}
</>
))}
{(operations.state === "loading") && ((
)}
{operations.state === "loading" && (
<LoadingSkeleton label={t("ledger.recentLoading")}>
{["first", "second", "third"].map(placeholder => (
<Skeleton height={48} key={placeholder} radius="sm" />
))}
</LoadingSkeleton>
))}
{(operations.state === "error") && ((
)}
{operations.state === "error" && (
<Alert color="red">{t("ledger.recentError")}</Alert>
))}
{(operations.state === "empty") && ((
)}
{operations.state === "empty" && (
<Text c="dimmed">{t("ledger.recentEmpty")}</Text>
))}
{(operations.state === "partial") && ((
)}
{operations.state === "partial" && (
<Text role="status">{t("investment.partial")}</Text>
))}
{(operations.state === "loaded" || operations.state === "partial") && (operations.items.map(operation => (
<LedgerEntryRow
key={JSON.stringify([
operation.account?.id,
operation.id,
operation.logoName,
])}
operation={operation}
/>
)))}
)}
{(operations.state === "loaded" || operations.state === "partial")
&& operations.items.map(operation => (
<LedgerEntryRow
key={JSON.stringify([
operation.account?.id,
operation.id,
operation.logoName,
])}
operation={operation}
/>
))}
<Button component={Link} to={operations.to} variant="subtle">
{t("ledger.open")}
</Button>