From e63ae89b0e26259c59ee8a790b91206c3ad8b39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Mon, 5 Aug 2024 15:41:40 +0200 Subject: [PATCH] fix(console): small table ui improvement (#6983) Hide the table heading when there aren't any rows. --- .../resource-panes/table-interaction.tsx | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/apps/wing-console/console/ui/src/features/inspector-pane/resource-panes/table-interaction.tsx b/apps/wing-console/console/ui/src/features/inspector-pane/resource-panes/table-interaction.tsx index 1c1faa5b6ca..c5d5eb04a91 100644 --- a/apps/wing-console/console/ui/src/features/inspector-pane/resource-panes/table-interaction.tsx +++ b/apps/wing-console/console/ui/src/features/inspector-pane/resource-panes/table-interaction.tsx @@ -21,6 +21,8 @@ export const TableInteraction = memo( .map((name) => ({ name, type: "text" })); }, [rows]); + const hasRows = rows && rows.length > 0; + return (
- - {columns.map(({ name }) => ( + {hasRows && ( + + {columns.map(({ name }) => ( + + {name} + + ))} - {name} - - ))} - - + > + + )} - {rows?.length === 0 && ( + {!hasRows && (