This commit is contained in:
@@ -7,8 +7,10 @@ import moment from 'moment-jalaali'
|
||||
import { CloseCircle, TickCircle } from 'iconsax-react'
|
||||
import { ErrorType } from '../../helpers/types'
|
||||
import { toast } from '../../components/Toast';
|
||||
import { usePermissions } from '../../hooks/usePermissions'
|
||||
const Comments: FC = () => {
|
||||
const { t } = useTranslation('global')
|
||||
const { canUpdate } = usePermissions()
|
||||
const getBlogComments = useGetBlogComments()
|
||||
const changeStatusComment = useChangeStatusComment()
|
||||
const handleChangeStatus = (id: string, status: string) => {
|
||||
@@ -49,7 +51,7 @@ const Comments: FC = () => {
|
||||
<Td text={moment(item.createdAt).format('jYYYY/jMM/jDD')} />
|
||||
<Td text=''>
|
||||
{
|
||||
item.status === 'PENDING' &&
|
||||
item.status === 'PENDING' && canUpdate('blog_comments') &&
|
||||
<div className='flex items-center gap-2'>
|
||||
<TickCircle onClick={() => handleChangeStatus(item.id, 'APPROVED')} color='green' size={20} />
|
||||
<CloseCircle onClick={() => handleChangeStatus(item.id, 'REJECTED')} color='red' size={20} />
|
||||
|
||||
Reference in New Issue
Block a user