ticket
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { type FC } from 'react'
|
||||
import Button from '@/components/Button'
|
||||
import { useOpenTicket } from '../hooks/useTicketData'
|
||||
|
||||
type Props = {
|
||||
id: string,
|
||||
refetch: () => void
|
||||
}
|
||||
|
||||
const OpenTicket: FC<Props> = ({ id, refetch }) => {
|
||||
|
||||
const { mutate: openTicket, isPending } = useOpenTicket()
|
||||
|
||||
const handleOpenTicket = () => {
|
||||
openTicket(id, {
|
||||
onSuccess: () => {
|
||||
refetch()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Button
|
||||
label={'باز کردن تیکت'}
|
||||
onClick={handleOpenTicket}
|
||||
className='px-4 h-8 text-xs'
|
||||
isLoading={isPending}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default OpenTicket
|
||||
Reference in New Issue
Block a user