import React from "react";
// import { useMany } from "@pankod/refine-core";
import {
useDataGrid,
DataGrid,
GridColumns,
ShowButton,
// TagField,
DateField,
EditButton,
Stack,
List,
} from "@pankod/refine-mui";
import { IFilterz } from "interfaces";
const columns: GridColumns = [
{ field: "filterz", headerName: "Filterz", flex: 1, minWidth: 350 },
{ field: "pro_rep_team", headerName: "Pro Rep Team", flex: 1, minWidth: 350 },
{ field: "product", headerName: "Product", flex: 1, minWidth: 350 },
{ field: "insurance", headerName: "Insurance", flex: 1, minWidth: 350 },
{ field: "type", headerName: "Type", flex: 1, minWidth: 350 },
{ field: "status", headerName: "Status", flex: 1, minWidth: 350 },
{
field: "date_rx_received",
headerName: "Date Rx RC'd",
minWidth: 220,
renderCell: function render(params) {
return (
<DateField format="LLL" value={params.row.date_rx_received} />
);
},
},
{
headerName: "Actions",
field: "actions",
minWidth: 250,
renderCell: function render(params) {
return (
<Stack direction="row" spacing={1}>
<EditButton hideText recordItemId={params.row.id} />
<ShowButton hideText recordItemId={params.row.id} />
</Stack>
);
},
},
];
export const FilterzList: React.FC = () => {
const { dataGridProps } = useDataGrid<IFilterz>({
dataProviderName: 'hasura'
});
return (
<List>
<DataGrid {...dataGridProps} columns={columns} autoHeight />
</List>
);
};