import { CalendarCheck2 } from 'lucide-react';

import { NestedDatatable } from '@@/datatables/NestedDatatable';

import { columns } from '../JobsDatatable/columns';
import { Job } from '../JobsDatatable/types';

interface CronJobsExecutionsProps {
  item: Job[];
}

export function CronJobsExecutionsInnerDatatable({
  item,
}: CronJobsExecutionsProps) {
  return (
    <NestedDatatable
      dataset={item}
      columns={columns}
      getRowId={(row) => row.Id}
      data-cy="k8s-cronJobs-executions-datatable"
      enablePagination={false}
      title="Executions"
      titleIcon={CalendarCheck2}
    />
  );
}
