Update columns.jsx

This commit is contained in:
Mathias Wagner
2024-07-22 12:15:37 +02:00
parent cc33d479a6
commit 26636c3b54

View File

@ -8,8 +8,10 @@ export default [
<Key/>{params.value}
</Stack>
},
{field: 'groups', headerName: 'Groups', width: 200},
{field: 'permissions', headerName: 'Permissions', width: 200},
{field: 'groups', headerName: 'Groups', width: 200, renderCell: (params) =>
params.value.length > 0 ? params.value.join(', ') : "-"},
{field: 'permissions', headerName: 'Permissions', width: 200, renderCell: (params) =>
params.value.length > 0 ? params.value.join(', ') : "-"},
{field: 'currentUses', headerName: 'Current uses', width: 180},
{
field: 'maxUses', headerName: 'Maximum uses', width: 180, renderCell: (params) =>
@ -20,7 +22,8 @@ export default [
new Date(params.value).getTime() === 0 ? "Never" : new Date(params.value).toLocaleString()
},
{
field: 'actions', headerName: 'Actions', width: 80, renderCell: () => <Stack direction="row" gap={1}>
field: 'actions', headerName: 'Actions', width: 80, renderCell: () => <Stack direction="row" gap={1}
height="100%" alignItems="center">
<IconButton size="small" color="primary"><Edit/></IconButton>
<IconButton size="small" color="error"><Delete/></IconButton>
</Stack>, sortable: false, filterable: false, align: 'center'