update list for project routes

This commit is contained in:
maxim
2025-03-16 21:18:38 +03:00
parent 191f495abe
commit 0eddd112ae
8 changed files with 82 additions and 33 deletions

View File

@ -2,6 +2,7 @@ import {type GridColDef} from '@mui/x-data-grid'
import {CustomDataGrid} from '../../components/CustomDataGrid'
import {DeleteButton, EditButton, List, ShowButton, useDataGrid} from '@refinedev/mui'
import React from 'react'
import {MEDIA_TYPES} from '../../lib/constants'
import {localeText} from '../../locales/ru/localeText'
@ -10,6 +11,15 @@ export const MediaList = () => {
const columns = React.useMemo<GridColDef[]>(
() => [
{
field: 'id',
headerName: 'ID',
type: 'number',
minWidth: 350,
display: 'flex',
align: 'left',
headerAlign: 'left',
},
{
field: 'filename',
headerName: 'Название',
@ -22,28 +32,23 @@ export const MediaList = () => {
{
field: 'media_type',
headerName: 'Тип',
type: 'number',
minWidth: 150,
display: 'flex',
align: 'left',
headerAlign: 'left',
},
{
field: 'id',
headerName: 'ID',
type: 'number',
type: 'string',
display: 'flex',
align: 'left',
headerAlign: 'left',
flex: 1,
renderCell: (params) => {
const value = params.row.media_type
return MEDIA_TYPES.find((type) => type.value === value)?.label || value
},
},
{
field: 'actions',
headerName: 'Действия',
align: 'right',
headerAlign: 'right',
minWidth: 120,
display: 'flex',
flex: 1,
align: 'right',
headerAlign: 'center',
sortable: false,
renderCell: function render({row}) {
return (