import { KhovtTransPhieuXuatDetailWithRelations } from 'main/apis/drc/models';
import BootstrapTable from 'react-bootstrap-table-next';
import ToolkitProvider from 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit';
import tableConfig from './table-config';

type Props = {
  supplies: KhovtTransPhieuXuatDetailWithRelations[];
};

function SuppliesStoreExportDetailTable({ supplies }: Props) {
  return (
    <ToolkitProvider data={supplies} keyField="id" columns={tableConfig.columns} exportCSV={tableConfig.exportCSV}>
      {(props: any) => (
        <div className="table-responsive">
          <BootstrapTable {...props.baseProps} bootstrap4={true} bordered={false} />
        </div>
      )}
    </ToolkitProvider>
  );
}

export default SuppliesStoreExportDetailTable;
