Skip to content

Commit

Permalink
updated to utilize useHistory hook, and removed unneccesary documenta…
Browse files Browse the repository at this point in the history
…tion attributes
  • Loading branch information
Christian Thomas Elfreich committed Oct 19, 2020
1 parent fc12499 commit 4e3715e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 8 additions & 6 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react';
import { useHistory } from "react-router-dom";
import PropTypes from 'prop-types'
import MaterialTable from "material-table";

export default function ItemTable({ data, history }) {

export default function ItemTable({ items }) {

const columns = [
{ title: 'Queue', field: 'queue', filterPlaceholder: "Ex: \"ME\"" },
Expand All @@ -26,10 +28,12 @@ export default function ItemTable({ data, history }) {
"padding": "dense",
}

const history = useHistory();

return (
<MaterialTable
columns={columns}
data={data}
data={items}
title={"Demo Table"}
options={options}
onRowClick={(_event, rowData) => {
Expand All @@ -41,9 +45,7 @@ export default function ItemTable({ data, history }) {

ItemTable.propTypes = {

/** Array is required to show data in table */
"data": PropTypes.array.isRequired,
/** Object is require to update URLs */
"history": PropTypes.object.isRequired
/** Array of items from all active queues to display in table. */
"items": PropTypes.array.isRequired

}
Loading

0 comments on commit 4e3715e

Please sign in to comment.