import { DataGrid } from "@material-ui/data-grid";

const List = (props) => {
  const selectEntryHandler = (data) => {
    props.onEntrySelect(data.selectionModel);
  };

  return (
    <div>
      <div></div>
      <div style={{ height: 400, width: "100%" }}>
        <DataGrid
          onSelectionModelChange={selectEntryHandler}
          rows={props.rows}
          columns={props.columns}
          pageSize={5}
          checkboxSelection
          loading={props.isLoading}
        />
      </div>
    </div>
  );
};

export default List;
