From e01d82a36399a53215cb8d163077da672e4fb127 Mon Sep 17 00:00:00 2001 From: Maciej Bodek Date: Wed, 11 Oct 2023 14:52:16 +0200 Subject: [PATCH] Add row count --- .../web-console/src/scenes/Result/index.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/web-console/src/scenes/Result/index.tsx b/packages/web-console/src/scenes/Result/index.tsx index 20de2e563..53cd25ede 100644 --- a/packages/web-console/src/scenes/Result/index.tsx +++ b/packages/web-console/src/scenes/Result/index.tsx @@ -32,11 +32,11 @@ import { HandPointLeft } from "@styled-icons/fa-regular" import { TableFreezeColumn } from "@styled-icons/fluentui-system-filled" import { grid } from "../../js/console/grid" import { quickVis } from "../../js/console/quick-vis" - import { PaneContent, PaneWrapper, PopperHover, + Text, Tooltip, useScreenSize, } from "../../components" @@ -84,6 +84,10 @@ const TableFreezeColumnIcon = styled(TableFreezeColumn)` transform: scaleX(-1); ` +const RowCount = styled(Text)` + margin-right: 1rem; +` + const Result = ({ viewMode }: { viewMode: ViewMode }) => { const [count, setCount] = useState() const { sm } = useScreenSize() @@ -227,10 +231,21 @@ const Result = ({ viewMode }: { viewMode: ViewMode }) => { }, ] + useEffect(() => { + if (result?.type === QuestDB.Type.DQL) { + setCount(result.count) + } + }, [result]) + return ( + {count && ( + + {`${count.toLocaleString()} row${count > 1 ? "s" : ""}`} + + )} {viewMode === "grid" && gridActions.map((action, index) => (