fix(ui): различать ошибки и пустую историю WireGuard

This commit is contained in:
Denozordec committed 2026-09-29 13:42:00 +07:00
1 parent 1d1de12c58
commit d0f5649725
7 files changed
+116 -14

No files matched your search

+9
View File
@@ -65,6 +65,8 @@ export function ConfigHistorySheet({
itemLabel,
revisions,
loading,
loadError,
onRetry,
restoring,
onRestore,
}: {
@@ -74,6 +76,8 @@ export function ConfigHistorySheet({
itemLabel: string
revisions: ConfigRevisionDto[]
loading: boolean
loadError?: string | null
onRetry?: () => void
restoring: boolean
onRestore: (id: string) => Promise<void> | void
}) {
@@ -122,6 +126,11 @@ export function ConfigHistorySheet({
<LoaderCircleIcon className="size-4 animate-spin" />
Загрузка истории…
</div>
) : loadError ? (
<div className="flex flex-col gap-3">
<p role="alert" className="text-sm text-destructive">Не удалось загрузить историю: {loadError}</p>
{onRetry && <Button type="button" variant="outline" disabled={busy} onClick={onRetry}>Повторить загрузку</Button>}
</div>
) : newestFirst.length === 0 ? (
<EmptyState
icon={<HistoryIcon className="size-4" />}