import { Table as TanstackTable } from "@tanstack/react-table";

import { Skeleton } from "../skeleton";
import { TableCell, TableRow } from "../table";

export function DataTableSkeleton({ table }: { table: TanstackTable<any> }) {
  return Array.from({ length: 10 }).map((_, i) => (
    <TableRow key={i}>
      {table.getAllColumns().map((column) => (
        <TableCell key={column.id}>
          <Skeleton className="h-8" />
        </TableCell>
      ))}
    </TableRow>
  ));
}
