admin
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { FC, useState } from 'react'
|
||||
import { FC, useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Eye, MessageRemove, MessageTick, MessageTime } from 'iconsax-react'
|
||||
import Tabs from '../../components/Tabs'
|
||||
import Td from '../../components/Td'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { Link, useSearchParams } from 'react-router-dom'
|
||||
import { Pages } from '../../config/Pages'
|
||||
import { useGetTickets } from './hooks/useTicketData'
|
||||
import moment from 'moment-jalaali'
|
||||
@@ -12,8 +12,18 @@ import { TicketItemType } from './types/TicketTypes'
|
||||
const TicketList: FC = () => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
const [searchParams] = useSearchParams()
|
||||
const [customerId, setCustomerId] = useState<string>('')
|
||||
const [activeTab, setActiveTab] = useState<'ANSWERED' | 'PENDING' | 'CLOSED'>('PENDING')
|
||||
const getTicket = useGetTickets(activeTab)
|
||||
const getTicket = useGetTickets(activeTab, customerId)
|
||||
|
||||
useEffect(() => {
|
||||
const urlCustomerId = searchParams.get('user')
|
||||
if (urlCustomerId) {
|
||||
setCustomerId(urlCustomerId)
|
||||
}
|
||||
}, [searchParams])
|
||||
|
||||
|
||||
return (
|
||||
<div className='mt-4'>
|
||||
|
||||
Reference in New Issue
Block a user