fix(ui): различать ошибки и пустую историю WireGuard
This commit is contained in:
1 parent
1d1de12c58
commit
d0f5649725
7 files changed
+116
-14
No files matched your search
@@ -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" />}
|
||||
|
||||
Reference in new issue
Block a user