Merge pull request 'Tạo page ticket management' (#7) from truong-sprint-1 into master

Reviewed-on: #7
This commit is contained in:
joseph 2024-08-08 13:37:32 +10:00
commit 34a40282c3
1 changed files with 15 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import { DataTablePagination } from '@/components/DataTable/DataTable'
import { Xdelete, create } from '@/rtk/helpers/CRUD' import { Xdelete, create } from '@/rtk/helpers/CRUD'
import { get } from '@/rtk/helpers/apiService' import { get } from '@/rtk/helpers/apiService'
import { import {
Badge,
Box, Box,
Button, Button,
Dialog, Dialog,
@ -179,13 +180,25 @@ const Tickets = () => {
name: 'status', name: 'status',
size: '8%', size: '8%',
header: 'Status', header: 'Status',
render: (row: any) => {
switch (row.status) {
case 'WAITING':
return <Badge color="blue">Waiting</Badge>
case 'CONFIRMED':
return <Badge color="green">Confirmed</Badge>
case 'REFUSED':
return <Badge color="red">Refused</Badge>
default:
return null
}
},
}, },
{ {
name: '#', name: '#',
size: '5%', size: '5%',
header: 'Action', header: 'Action',
render: (row: any) => { render: (row: any) => {
return ( return row.status === 'WAITING' ? (
<Box className={classes.optionIcon}> <Box className={classes.optionIcon}>
<IconTrash <IconTrash
className={classes.deleteIcon} className={classes.deleteIcon}
@ -197,7 +210,7 @@ const Tickets = () => {
height={20} height={20}
/> />
</Box> </Box>
) ) : null
}, },
}, },
] ]