fix(backups): разделить загрузку каталогов и права действий

This commit is contained in:
Denozordec committed 2026-10-01 15:06:52 +07:00
1 parent b460997cbf
commit 3dcc7c9ea6
11 files changed
+259 -91

No files matched your search

+9 -1
View File
@@ -28,6 +28,9 @@ export function BackupsHistory({
onRestore,
onDelete,
onCreate,
canCreate = true,
canWrite = true,
canDownload = true,
}: {
backups: Backup[]
kindFilter: KindFilter
@@ -39,6 +42,9 @@ export function BackupsHistory({
onDownload: (id: string, filename: string) => void
onRestore: (backup: Backup) => void
onDelete: (backup: Backup) => void
canCreate?: boolean
canWrite?: boolean
canDownload?: boolean
onCreate: () => void
}) {
const autoCount = backups.filter((b) => b.kind === "auto").length
@@ -76,6 +82,8 @@ export function BackupsHistory({
onDownload={onDownload}
onRestore={onRestore}
onDelete={onDelete}
canWrite={canWrite}
canDownload={canDownload}
emptyTitle={isEmptyAll ? "Нет бэкапов" : "Ничего не найдено"}
emptyDescription={
isEmptyAll
@@ -83,7 +91,7 @@ export function BackupsHistory({
: "Измените фильтры или поисковый запрос"
}
emptyAction={
isEmptyAll ? (
isEmptyAll && canCreate ? (
<Button type="button" size="sm" onClick={onCreate}>
<PlusIcon className="size-4" />
Новый бэкап