import {
useDataGrid,
DataGrid,
GridColumns,
List,
ShowButton,
} from '@pankod/refine-mui'
const columns: GridColumns = [
{ field: 'id', headerName: 'ID', type: 'number' },
{ field: 'title', headerName: 'Title', minWidth: 400, flex: 1 },
{
field: 'actions',
headerName: 'Actions',
renderCell: function render({ row }) {
return <ShowButton size="small" recordItemId={row.id} />
},
align: 'center',
headerAlign: 'center',
minWidth: 80,
},
]
const PostsList: React.FC = () => {
const { dataGridProps } = useDataGrid<IPost>()
return (
<List>
<DataGrid {...dataGridProps} columns={columns} autoHeight />
</List>
)
}
interface IPost {
id: number
title: string
}