import React, { useMemo } from 'react';
import { DataTable } from '../common';
// Import any additional components you need
import { createColumnHelper } from '@tanstack/react-table';
const RecentJobsTable = ({ order, loading, pagination }) => {
  const columns = useMemo(() => [
    {
      accessorKey: 'job', // Accessor is the "key" in the data
      header: 'Job',
    },
    {
      accessorKey: 'status', // Accessor is the "key" in the data
      header: 'Status',
      cell: (info) => info.getValue() === 'in progress' ? 'In Progress' : 'Failed',
    },
  ], []);

  // Fake data array
  const data = useMemo(() => [
    { id: 1, job: 'Data Analysis', status: 'in progress' },
    { id: 2, job: 'Data Entry', status: 'failed' },
    { id: 3, job: 'Data Entry', status: 'failed' },
    // ... more data
  ], []);

  return (
    <DataTable
      columns={columns}
      data={data}
      order={order}
      loading={loading}
      pagination={pagination}
    />
  );
};

export default RecentJobsTable;
