From f651ca84fa31d585a78e745f4cb114222c08e320 Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Wed, 22 Apr 2026 17:43:29 -0700 Subject: [PATCH] remove empty table state lines --- .../AlertRuleGraphEditor.tsx | 14 ++-- src/components/ui/controlled-data-table.tsx | 70 ++++++++++--------- src/components/ui/data-table-empty-state.tsx | 5 +- 3 files changed, 48 insertions(+), 41 deletions(-) diff --git a/src/components/alert-rule-editor/AlertRuleGraphEditor.tsx b/src/components/alert-rule-editor/AlertRuleGraphEditor.tsx index 273e8b637..e1e71507b 100644 --- a/src/components/alert-rule-editor/AlertRuleGraphEditor.tsx +++ b/src/components/alert-rule-editor/AlertRuleGraphEditor.tsx @@ -77,11 +77,11 @@ function VerticalRuleStep({ className="flex flex-col items-center gap-0 shrink-0 w-8" aria-hidden > -
+
{stepNumber}
{!isLast && ( -
+
)}
{isNew && ( - + {t("alertingDraftBadge")} )} @@ -209,7 +209,9 @@ export default function AlertRuleGraphEditor({ render={({ field }) => ( - {t("alertingRuleCooldown")} + {t( + "alertingRuleCooldown" + )} - {t("alertingRuleCooldownDescription")} + {t( + "alertingRuleCooldownDescription" + )} diff --git a/src/components/ui/controlled-data-table.tsx b/src/components/ui/controlled-data-table.tsx index a08479597..58081783a 100644 --- a/src/components/ui/controlled-data-table.tsx +++ b/src/components/ui/controlled-data-table.tsx @@ -256,31 +256,39 @@ export function ControlledDataTable({ addButtonText && ((addActions && addActions.length > 0) || onAdd) ); const showAddActionInEmptyState = !hasRows && hasAddAction; - const addAction = addActions && addActions.length > 0 && addButtonText ? ( - - - - - - {addActions.map((action, i) => ( - action.onSelect()}> - {action.label} - - ))} - - - ) : onAdd && addButtonText ? ( - - ) : null; + const addAction = + addActions && addActions.length > 0 && addButtonText ? ( + + + + + + {addActions.map((action, i) => ( + action.onSelect()} + > + {action.label} + + ))} + + + ) : onAdd && addButtonText ? ( + + ) : null; return (
@@ -606,13 +614,11 @@ export function ControlledDataTable({ - {addAction} -
- ) - : undefined + showAddActionInEmptyState ? ( +
+ {addAction} +
+ ) : undefined } /> )} diff --git a/src/components/ui/data-table-empty-state.tsx b/src/components/ui/data-table-empty-state.tsx index 793c360f4..e7da09f03 100644 --- a/src/components/ui/data-table-empty-state.tsx +++ b/src/components/ui/data-table-empty-state.tsx @@ -26,10 +26,7 @@ export function DataTableEmptyState({ > {Array.from({ length: PLACEHOLDER_ROW_COUNT }).map( (_, i) => ( -
+
) )}