From fef2d2cc82bad5a7e89061ab7445a2c4770604b1 Mon Sep 17 00:00:00 2001 From: Lakee Sivaraya Date: Thu, 15 Jan 2026 19:58:43 -0800 Subject: [PATCH] fix appearnce --- .../components/table-query-builder.tsx | 16 +++++++++---- .../components/table-body-states.tsx | 24 ++++++++++--------- .../table-data-viewer/table-data-viewer.tsx | 13 ++++++---- 3 files changed, 34 insertions(+), 19 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-query-builder.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-query-builder.tsx index 212765d88..3bc1be9f7 100644 --- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-query-builder.tsx +++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-query-builder.tsx @@ -1,7 +1,7 @@ 'use client' import { useCallback, useMemo, useState } from 'react' -import { ArrowDownAZ, ArrowUpAZ, Plus, X } from 'lucide-react' +import { ArrowDownAZ, ArrowUpAZ, Loader2, Plus, X } from 'lucide-react' import { nanoid } from 'nanoid' import { Button, Combobox, Input } from '@/components/emcn' import type { FilterCondition, SortCondition } from '@/lib/table/filters/constants' @@ -39,6 +39,8 @@ interface TableQueryBuilderProps { onApply: (options: QueryOptions) => void /** Callback to add a new row */ onAddRow: () => void + /** Whether a query is currently loading */ + isLoading?: boolean } /** @@ -59,7 +61,12 @@ interface TableQueryBuilderProps { * /> * ``` */ -export function TableQueryBuilder({ columns, onApply, onAddRow }: TableQueryBuilderProps) { +export function TableQueryBuilder({ + columns, + onApply, + onAddRow, + isLoading = false, +}: TableQueryBuilderProps) { const [conditions, setConditions] = useState([]) const [sortCondition, setSortCondition] = useState(null) @@ -174,8 +181,9 @@ export function TableQueryBuilder({ columns, onApply, onAddRow }: TableQueryBuil {hasChanges && ( <> - - )} + +
+
+ + {hasFilter ? 'No rows match your filter' : 'No data'} + + {!hasFilter && ( + + )} +
diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table-data-viewer/table-data-viewer.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table-data-viewer/table-data-viewer.tsx index e9a40e326..06634c1f4 100644 --- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table-data-viewer/table-data-viewer.tsx +++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table-data-viewer/table-data-viewer.tsx @@ -111,10 +111,14 @@ export function TableDataViewer() { /** * Applies new query options and resets pagination. */ - const handleApplyQueryOptions = useCallback((options: QueryOptions) => { - setQueryOptions(options) - setCurrentPage(0) - }, []) + const handleApplyQueryOptions = useCallback( + (options: QueryOptions) => { + setQueryOptions(options) + setCurrentPage(0) + refetchRows() + }, + [refetchRows] + ) /** * Opens the delete modal for selected rows. @@ -204,6 +208,7 @@ export function TableDataViewer() { columns={columns} onApply={handleApplyQueryOptions} onAddRow={handleAddRow} + isLoading={isLoadingRows} /> {hasSelection && ( {selectedCount} selected