import React, { useMemo } from 'react';
import { DataTable } from '../common';
// Import any additional components you need
import { createColumnHelper } from '@tanstack/react-table';

const LastRecordsTable = ({ order, loading, pagination }) => {
  const columnHelper = createColumnHelper();

  // Define the columns for the DataTable
  const columns = useMemo(() => [
    columnHelper.accessor('fileName', {
      header: () => 'File name',
      cell: (info) => info.getValue(),
    }),
    columnHelper.accessor('dateTime', {
      header: () => 'Date/Time',
      cell: (info) => info.getValue(),
    }),
  ], [columnHelper]);

  // Create fake data for demonstration purposes
  const fakeData = useMemo(() => [
    { id: 1, fileName: 'Report1.pdf', dateTime: '28/11/2023' },
    { id: 2, fileName: 'Summary.xlsx', dateTime: '29/11/2023' },
    { id: 3, fileName: 'Summary.xlsx', dateTime: '29/11/2023' },
    // { id: 4, fileName: 'Summary.xlsx', dateTime: '29/11/2023' },
    // { id: 5, fileName: 'Summary.xlsx', dateTime: '29/11/2023' },
    // ... more rows as needed
  ], []);

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

// Define the propTypes for LastRecordsTable if necessary

export default LastRecordsTable;
