'use client'; import { FileVideo } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import type { UploadVideo } from '@/types'; import { CardPagination } from './CardPagination'; import { UploadActionsMenu } from './UploadActionsMenu'; import { UploadThumbnail } from './UploadThumbnail'; import { formatUploadedAt } from './uploadUtils'; interface UploadCardGridProps { uploads: UploadVideo[]; isLoading: boolean; skip: number; limit: number; total: number; onPageChange: (skip: number) => void; onLimitChange: (limit: number) => void; onUploadNew: () => void; onOpenUpload: (upload: UploadVideo) => void; onViewVideo: (upload: UploadVideo) => void; onViewDetails: (upload: UploadVideo) => void; } export function UploadCardGrid({ uploads, isLoading, skip, limit, total, onPageChange, onLimitChange, onUploadNew, onOpenUpload, onViewVideo, onViewDetails, }: UploadCardGridProps) { const skeletonItems = Array.from({ length: 6 }); if (!isLoading && uploads.length === 0) { return (

No uploads found

Upload your first road inspection video.

); } return (
{isLoading ? skeletonItems.map((_, index) => ( )) : uploads.map((upload) => ( onOpenUpload(upload)} >

{upload.filename}

Uploaded {formatUploadedAt(upload.uploaded_at)}

))}
); }