This commit is contained in:
hamid zarghami
2025-03-03 15:29:50 +03:30
parent 37081ae981
commit dcf786330c
8 changed files with 53 additions and 15 deletions
+13 -3
View File
@@ -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'>