11import React , { useCallback , useEffect , useRef , useState } from 'react' ;
22
3- import { PADDING_END , useDatabaseContext , useDatabaseView } from '@/application/database-yjs' ;
4- import { YjsDatabaseKey } from '@/application/types' ;
3+ import { PADDING_END , useDatabaseContext } from '@/application/database-yjs' ;
54import LoadingDots from '@/components/_shared/LoadingDots' ;
65import { GridDragContext } from '@/components/database/components/grid/drag-and-drop/GridDragContext' ;
76import { RenderColumn } from '@/components/database/components/grid/grid-column/useRenderFields' ;
@@ -22,8 +21,6 @@ function GridVirtualizer({ columns }: { columns: RenderColumn[] }) {
2221 const { rows : data , resizeRows, onResizeRowEnd } = useGridContext ( ) ;
2322 const { handleResizeStart, isResizing } = useColumnResize ( columns ) ;
2423 const { isDocumentBlock, paddingEnd } = useDatabaseContext ( ) ;
25- const view = useDatabaseView ( ) ;
26- const hasConditions = ( view ?. get ( YjsDatabaseKey . sorts ) ?. length ?? 0 ) > 0 || ( view ?. get ( YjsDatabaseKey . filters ) ?. length ?? 0 ) > 0 ;
2724
2825 const { parentRef, virtualizer, columnVirtualizer, scrollMarginTop, isReady } = useGridVirtualizer ( {
2926 data,
@@ -33,9 +30,6 @@ function GridVirtualizer({ columns }: { columns: RenderColumn[] }) {
3330 const rowItems = virtualizer . getVirtualItems ( ) ;
3431 const columnItems = columnVirtualizer . getVirtualItems ( ) ;
3532 const totalSize = columnVirtualizer . getTotalSize ( ) ;
36- const hasRegularRows = data . some ( ( row ) => row . type === RenderRowType . Row ) ;
37- const hasPlaceholderRow = data . some ( ( row ) => row . type === RenderRowType . PlaceholderRow ) ;
38- const showEmptyBodyLoading = hasConditions && ! hasRegularRows && ! hasPlaceholderRow ;
3933
4034 const contextValue = useGridDnd ( columns , virtualizer , columnVirtualizer ) ;
4135 const bottomScrollbarRef = useRef < HTMLDivElement > ( null ) ;
@@ -234,21 +228,6 @@ function GridVirtualizer({ columns }: { columns: RenderColumn[] }) {
234228 </ div >
235229 ) ;
236230 } ) }
237- { showEmptyBodyLoading && (
238- < div
239- className = { 'absolute flex min-h-[240px] items-center justify-center' }
240- role = { 'status' }
241- style = { {
242- top : 36 ,
243- left : 0 ,
244- paddingLeft : columnItems [ 0 ] ?. start ,
245- paddingRight : isDocumentBlock ? 0 : PADDING_INLINE ,
246- width : totalSize - ( paddingEnd ?? 0 ) ,
247- } }
248- >
249- < LoadingDots className = { 'flex items-center justify-center opacity-80' } />
250- </ div >
251- ) }
252231 </ div >
253232 { ! isDocumentBlock && (
254233 < DatabaseStickyTopOverlay >
0 commit comments