'use client'; import { useMemo } from 'react'; import type { ColumnDef } from '@tanstack/react-table'; import { UploadActionsMenu } from './UploadActionsMenu'; import { UploadThumbnail } from './UploadThumbnail'; import { formatUploadedAt, getUploadStatus } from './uploadUtils'; import { Badge } from '@/components/ui/badge'; import type { UploadVideo } from '@/types'; interface UseUploadColumnsProps { onViewVideo: (upload: UploadVideo) => void; onViewDetails: (upload: UploadVideo) => void; } export function useUploadColumns({ onViewVideo, onViewDetails, }: UseUploadColumnsProps) { return useMemo[]>( () => [ { id: 'thumbnail', header: 'Thumbnail', size: 140, minSize: 120, enableSorting: false, meta: { disableTruncate: true }, cell: ({ row }) => ( ), }, { accessorKey: 'filename', header: 'Filename', cell: ({ row }) => ( {row.original.filename} ), }, { id: 'status', header: 'Status', size: 130, cell: ({ row }) => ( {getUploadStatus(row.original)} ), }, { accessorKey: 'uploaded_at', header: 'Uploaded At', cell: ({ row }) => formatUploadedAt(row.original.uploaded_at), }, { id: 'actions', header: () => Actions, size: 56, minSize: 56, enableSorting: false, enableHiding: false, meta: { disableTruncate: true }, cell: ({ row }) => (
), }, ], [onViewDetails, onViewVideo], ); }