From 0a4293b735f9a1acb7de0d3977ba3d2c525a7d7e Mon Sep 17 00:00:00 2001 From: Denozordec Date: Sat, 18 Jul 2026 20:33:48 +0700 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=D1=86=D0=B5=D0=BD=D1=82=D1=80=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20EmptyState=20=D0=BF?= =?UTF-8?q?=D0=BE=20empty-state-12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ResourcePage оборачивает пустой список в Frame; в панелях — centered=false. Co-authored-by: Cursor --- .../src/components/domain-bindings-card.tsx | 1 + .../domains/domain-availability-panel.tsx | 1 + apps/web/src/components/empty-state.tsx | 39 +++++++++++++++++-- .../src/components/health/health-timeline.tsx | 1 + .../src/components/reui-kit/resource-page.tsx | 31 ++++++++++++--- .../web/src/components/service-edit-sheet.tsx | 1 + 6 files changed, 66 insertions(+), 8 deletions(-) diff --git a/apps/web/src/components/domain-bindings-card.tsx b/apps/web/src/components/domain-bindings-card.tsx index de21207..c875b14 100644 --- a/apps/web/src/components/domain-bindings-card.tsx +++ b/apps/web/src/components/domain-bindings-card.tsx @@ -87,6 +87,7 @@ export function DomainBindingsCard({ bindings }: DomainBindingsCardProps) { icon={Link2Icon} title="Нет привязок" description="Привяжите сервис к поддомену" + centered={false} /> ) : ( diff --git a/apps/web/src/components/domains/domain-availability-panel.tsx b/apps/web/src/components/domains/domain-availability-panel.tsx index 71fff12..ca3a751 100644 --- a/apps/web/src/components/domains/domain-availability-panel.tsx +++ b/apps/web/src/components/domains/domain-availability-panel.tsx @@ -243,6 +243,7 @@ export function DomainAvailabilityPanel({ icon={ActivityIcon} title="Мониторы не настроены" description="Добавьте hostname для проверки доступности" + centered={false} /> ) : ( diff --git a/apps/web/src/components/empty-state.tsx b/apps/web/src/components/empty-state.tsx index cef336f..acff7ab 100644 --- a/apps/web/src/components/empty-state.tsx +++ b/apps/web/src/components/empty-state.tsx @@ -18,8 +18,18 @@ interface EmptyStateProps { className?: string /** Use IconStack media (empty-state-12). Default true. */ stackedIcon?: boolean + /** + * Center in available width/height (empty-state-12). + * Preview: https://reui.io/preview/base/empty-state-12 + * Set false for tight panels/sheets. + */ + centered?: boolean } +/** + * ReUI Empty + IconStack — adapted from empty-state-12. + * @see https://reui.io/preview/base/empty-state-12 + */ export function EmptyState({ icon: Icon = InboxIcon, title, @@ -27,9 +37,15 @@ export function EmptyState({ action, className, stackedIcon = true, + centered = true, }: EmptyStateProps) { - return ( - + const body = ( + {stackedIcon ? ( @@ -53,7 +69,24 @@ export function EmptyState({ ) : null} - {action ? {action} : null} + {action ? ( + + {action} + + ) : null} ) + + if (!centered) return body + + return ( +
+ {body} +
+ ) } diff --git a/apps/web/src/components/health/health-timeline.tsx b/apps/web/src/components/health/health-timeline.tsx index d53b3cb..0a35290 100644 --- a/apps/web/src/components/health/health-timeline.tsx +++ b/apps/web/src/components/health/health-timeline.tsx @@ -36,6 +36,7 @@ export function HealthTimeline({ events }: HealthTimelineProps) { icon={Link2Icon} title="Нет событий" description="Результаты проверок появятся после первого прогона" + centered={false} /> ) } diff --git a/apps/web/src/components/reui-kit/resource-page.tsx b/apps/web/src/components/reui-kit/resource-page.tsx index b8209ee..d875cec 100644 --- a/apps/web/src/components/reui-kit/resource-page.tsx +++ b/apps/web/src/components/reui-kit/resource-page.tsx @@ -242,11 +242,32 @@ export function ResourcePage({ if (data.length === 0 && emptyState) { return ( - + + {!hideHeader ? ( + +
+ {title} + {description ? ( + + {description} + + ) : null} +
+ {primaryAction ? ( +
+ {primaryAction} +
+ ) : null} +
+ ) : null} + + + + ) } diff --git a/apps/web/src/components/service-edit-sheet.tsx b/apps/web/src/components/service-edit-sheet.tsx index 6c771e0..cc6a072 100644 --- a/apps/web/src/components/service-edit-sheet.tsx +++ b/apps/web/src/components/service-edit-sheet.tsx @@ -509,6 +509,7 @@ export function ServiceEditSheet({ icon={Link2Icon} title="Нет привязок" description="Необязательно. Пример: newdom.ivx.su — зона ivx.su определится автоматически." + centered={false} action={