From 031a6fdf3ccf5324d9b606e97d0d1753e43f0e20 Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Sat, 25 Apr 2026 23:26:34 -0400 Subject: [PATCH] feat(client): unified EmptyState across all pages and table empties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New EmptyState + EmptyStateIllustration components: stacked-cards SVG with grid background, theme-aware light/dark palette. - Variants: default (centered with title + description), compact (horizontal, in-section), fullscreen (vertically centers in viewport). - Wired into Checks, Incidents, Logs (Logs+Queue tabs), Notifications, Maintenance, Status pages, and Team tab — each with i18n title + description and a fullscreen layout when truly empty. - Table.EmptyView now wraps the EmptyState in a divider-bordered card so short messages no longer look orphaned. - Incidents Option-A short-circuit: when summary.total === 0, replace the whole page chrome with EmptyState; otherwise keep filters + cards. - Fallback.tsx (BaseFallback / EmptyFallback / EmptyMonitorFallback / ErrorFallback) refactored to delegate to EmptyState. --- .../Components/design-elements/EmptyState.tsx | 3 + .../EmptyStateIllustration.tsx | 95 ++++++++----------- .../Components/design-elements/Fallback.tsx | 20 ++-- .../src/Components/design-elements/Table.tsx | 50 ++-------- client/src/Pages/Account/TabTeam.tsx | 16 +++- client/src/Pages/Checks/index.tsx | 14 ++- client/src/Pages/Incidents/index.tsx | 25 +++-- client/src/Pages/Logs/TabLogs.tsx | 13 ++- client/src/Pages/Logs/TabQueue.tsx | 80 +++++++++++++--- client/src/Pages/Maintenance/index.tsx | 5 +- client/src/Pages/Notifications/index.tsx | 5 +- .../Pages/StatusPage/StatusPages/index.tsx | 7 +- 12 files changed, 188 insertions(+), 145 deletions(-) diff --git a/client/src/Components/design-elements/EmptyState.tsx b/client/src/Components/design-elements/EmptyState.tsx index d6795e1e9..97b0d6166 100644 --- a/client/src/Components/design-elements/EmptyState.tsx +++ b/client/src/Components/design-elements/EmptyState.tsx @@ -17,6 +17,7 @@ interface EmptyStateProps { secondaryText?: string; secondaryHref?: string; compact?: boolean; + fullscreen?: boolean; alert?: ReactNode; children?: ReactNode; } @@ -30,6 +31,7 @@ export const EmptyState = ({ secondaryText, secondaryHref, compact = false, + fullscreen = false, alert, children, }: EmptyStateProps) => { @@ -78,6 +80,7 @@ export const EmptyState = ({ alignItems="center" justifyContent="center" sx={{ + ...(fullscreen && { minHeight: "65vh" }), py: theme.spacing(LAYOUT.XXL), px: theme.spacing(LAYOUT.MD), textAlign: "center", diff --git a/client/src/Components/design-elements/EmptyStateIllustration.tsx b/client/src/Components/design-elements/EmptyStateIllustration.tsx index e8f74ed88..ba69ede84 100644 --- a/client/src/Components/design-elements/EmptyStateIllustration.tsx +++ b/client/src/Components/design-elements/EmptyStateIllustration.tsx @@ -1,12 +1,37 @@ +import { useTheme } from "@mui/material/styles"; + interface EmptyStateIllustrationProps { width?: number | string; height?: number | string; } +const PALETTE = { + light: { + grid: "#CBD5E1", + backFill: "#F5F7FA", + backStroke: "#D5DBE3", + backInner: "#B6C2CF", + frontFill: "#EEF4FE", + frontStroke: "#7DA8E8", + frontInner: "#7DA8E8", + }, + dark: { + grid: "#3A4452", + backFill: "#475569", + backStroke: "#64748B", + backInner: "#CBD5E1", + frontFill: "#1E40AF", + frontStroke: "#60A5FA", + frontInner: "#DBEAFE", + }, +}; + export const EmptyStateIllustration = ({ width = 160, height = 120, }: EmptyStateIllustrationProps) => { + const theme = useTheme(); + const p = theme.palette.mode === "dark" ? PALETTE.dark : PALETTE.light; return (