mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 19:05:06 +03:00
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Logo field now accepts/editable logo URL, plus a new storage-based Logo Picker to select or remove images from project storage. * Full storage picker: browse buckets, columns/list views, search, drag‑and‑drop uploads, file previews (image/audio/video), and single-file selection with responsive mobile/desktop layouts. * **Refactor** * Logo submission streamlined to send the provided URL directly (legacy file-read/upload flow removed). <!-- end of auto-generated comment: release notes by coderabbit.ai -->
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { useIntersectionObserver } from '@uidotdev/usehooks'
|
|
import { useEffect, type ReactNode } from 'react'
|
|
import { TableCell, TableRow } from 'ui'
|
|
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
|
|
|
|
import type { BucketsTablePaginationProps } from './types'
|
|
import { VirtualizedTableCell, VirtualizedTableRow } from '@/components/ui/VirtualizedTable'
|
|
|
|
type LoadMoreRowProps = {
|
|
mode: 'standard' | 'virtualized'
|
|
colSpan: number
|
|
} & BucketsTablePaginationProps
|
|
|
|
export const LoadMoreRow = ({
|
|
mode,
|
|
colSpan,
|
|
|
|
hasMore = false,
|
|
isLoadingMore = false,
|
|
onLoadMore,
|
|
}: LoadMoreRowProps): ReactNode => {
|
|
const [sentinelRef, entry] = useIntersectionObserver({
|
|
threshold: 0,
|
|
rootMargin: '200px 0px 200px 0px',
|
|
})
|
|
|
|
useEffect(() => {
|
|
if (entry?.isIntersecting && hasMore && !isLoadingMore) {
|
|
onLoadMore?.()
|
|
}
|
|
}, [entry?.isIntersecting, hasMore, isLoadingMore, onLoadMore])
|
|
|
|
if (!hasMore && !isLoadingMore) return null
|
|
|
|
const RowComponent = mode === 'standard' ? TableRow : VirtualizedTableRow
|
|
const CellComponent = mode === 'standard' ? TableCell : VirtualizedTableCell
|
|
|
|
return (
|
|
<RowComponent ref={sentinelRef}>
|
|
{Array.from({ length: colSpan }, (_, idx) => (
|
|
<CellComponent key={idx}>
|
|
{idx !== 0 && idx !== colSpan - 1 && <ShimmeringLoader className="w-3/4" />}
|
|
</CellComponent>
|
|
))}
|
|
</RowComponent>
|
|
)
|
|
}
|