From 80e732e88300cd1df64269bb82272df1fd7f0953 Mon Sep 17 00:00:00 2001 From: 1Judah <1Judah@users.noreply.github.com> Date: Thu, 15 Oct 2026 17:56:32 +0100 Subject: [PATCH] feat(property-list): show empty state when no properties Also repairs the virtualizer row count, which after the memoization refactor was left referencing the removed rowCount binding, to use the length of the chunked rows array. --- src/components/VirtualizedPropertyGrid.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/VirtualizedPropertyGrid.tsx b/src/components/VirtualizedPropertyGrid.tsx index 529f3909..71f5da9c 100644 --- a/src/components/VirtualizedPropertyGrid.tsx +++ b/src/components/VirtualizedPropertyGrid.tsx @@ -3,6 +3,7 @@ import React, { memo, useMemo, useRef, useEffect, useState } from 'react'; import { useVirtualizer } from '@tanstack/react-virtual'; import { PropertyCard } from './PropertyCard'; import { ErrorBoundary } from './ui/SimpleErrorBoundary'; +import { PropertyEmptyState } from './ui/EmptyState'; import type { Property } from '@/types/property'; interface VirtualizedPropertyGridProps { @@ -49,16 +50,20 @@ const VirtualizedPropertyGridInner: React.FC = ({ // its inputs change instead of on every render of the grid. const virtualizerOptions = useMemo( () => ({ - count: rowCount, + count: rows.length, getScrollElement: () => parentRef.current, estimateSize: () => (viewMode === 'grid' ? 450 : 200), overscan: 5, }), - [rowCount, viewMode] + [rows.length, viewMode] ); const rowVirtualizer = useVirtualizer(virtualizerOptions); + if (properties.length === 0) { + return ; + } + return (