import { useRef } from 'react'
import { Table, TableBody } from 'ui'
import { LoadMoreRow } from './BucketsTable.LoadMoreRow'
import { BucketTableHeader } from './BucketTableHeader'
import { BucketTableRow } from './BucketTableRow'
import type { AllowedBucketType, BucketsTablePaginationProps } from './types'
import { TableRowNoResults } from '@/components/ui/TableRowNoResults'
import { VirtualizedTable, VirtualizedTableBody } from '@/components/ui/VirtualizedTable'
import { type Bucket } from '@/data/storage/buckets-query'
type BucketsTableProps = {
buckets: Bucket[]
projectRef: string
filterString: string
formattedGlobalUploadLimit: string
onSelectBucket: (bucket: Bucket) => void
allowedBucketType: AllowedBucketType
pagination: BucketsTablePaginationProps
}
export const BucketsTable = (props: BucketsTableProps) => {
const isVirtualized = props.buckets.length > 50
return isVirtualized ? (