// R-P5 Interim-UI (AD-28) — sync-run detail screen composed from ~/ui (D-P5 // "Sync-Run-Detail", archetype A3): run header with item counters + Klartext // summary, AppSyncItem table (entity ↔ external id, operation, status, Klartext // error) and the AppSyncRunLog lines with severity badges. Pure presentational. // Final Subframe optics = tracked design-nachzug. import { useTranslation } from "react-i18next"; import { FeatherRefreshCw } from "@subframe/core"; import type { SyncRunDetailVM } from "@hivegrid/view-models"; import { Alert } from "~/ui/components/Alert"; import { BadgeFeedback } from "~/ui/components/BadgeFeedback"; import { Card } from "~/ui/components/Card"; import { EmptyState } from "~/ui/components/EmptyState"; import { Table } from "~/ui/components/Table"; import { PageBackLink, PageBody, PageShell } from "../shared/PageShell"; import { syncItemStatusBadge, syncLogSeverityBadge, syncStatusBadge } from "./integrationsBadges"; import { APP_TIME_ZONE } from "~/locale/format"; export type SyncRunDetailPageProps = { vm: SyncRunDetailVM; backHref: string; }; export function SyncRunDetailPage({ vm, backHref }: SyncRunDetailPageProps) { const { t, i18n } = useTranslation(); if (vm.status !== "ready" || !vm.data) { return ; } const data = vm.data; const dateFormatter = new Intl.DateTimeFormat(i18n.language, { timeZone: APP_TIME_ZONE, dateStyle: "medium", timeStyle: "short" }); return ( {/* Breadcrumb back to the sync history (DoD B9) */} {/* Embedded in the Erweiterungen hub (AK-SET-01): the hub owns the page and tab bar, so this screen carries a simple section heading. */} {t("integrations.runDetail.title")} {t(data.kindKey)} · {data.startedIso ? dateFormatter.format(new Date(data.startedIso)) : "—"} {t(data.statusKey)} {/* Counters + Klartext summary */} {t("integrations.runDetail.stats.total")} {data.itemsTotal} {t("integrations.runDetail.stats.succeeded")} {data.itemsSucceeded} {t("integrations.runDetail.stats.failed")} {data.itemsFailed} {data.summaryKey ? ( {t(data.summaryKey)} ) : null} {data.status === "failed" ? : null} {/* AppSyncItem table (A3) */} {t("integrations.runDetail.itemsHeadline")} {data.items.length === 0 ? ( ) : ( {t("integrations.runDetail.column.entity")} {t("integrations.runDetail.column.externalId")} {t("integrations.runDetail.column.operation")} {t("integrations.runDetail.column.status")} {t("integrations.runDetail.column.error")} } > {data.items.map((item) => ( {item.entityType} {item.entityId ? ` · ${item.entityId}` : ""} {item.externalId} {t(item.operationKey)} {t(item.statusKey)} {item.errorText ? t(item.errorText) : "—"} ))} )} {/* AppSyncRunLog lines with severity */} {t("integrations.runDetail.logsHeadline")} {data.logs.map((log) => ( {t(log.severityKey)} {t(log.messageKey)} {dateFormatter.format(new Date(log.createdIso))} ))} ); }