"use client"; import { useTransition } from "react"; import { useRouter } from "next/navigation"; import { toast } from "sonner"; import { RotateCw } from "lucide-react"; import { useDataTable } from "@/hooks/use-data-table"; import { getSkippedColumns, type SkippedRow } from "./skipped-columns"; import { DataTable } from "@/components/shared/data-table"; import { DataTablePagination } from "@/components/shared/data-table-pagination"; import { Button } from "@/components/ui/button"; import { retrySkippedPackageAction, retryAllSkippedPackagesAction } from "../actions"; interface SkippedPackagesTabProps { data: SkippedRow[]; pageCount: number; totalCount: number; } export function SkippedPackagesTab({ data, pageCount, totalCount, }: SkippedPackagesTabProps) { const router = useRouter(); const [isPending, startTransition] = useTransition(); const columns = getSkippedColumns({ onRetry: (row) => { startTransition(async () => { const result = await retrySkippedPackageAction(row.id); if (result.success) { toast.success(`"${row.fileName}" queued for retry`); router.refresh(); } else { toast.error(result.error); } }); }, }); const { table } = useDataTable({ data, columns, pageCount }); return (