fix complaint view bug
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "no-copy-frontend",
|
"name": "no-copy-frontend",
|
||||||
"version": "0.110.0",
|
"version": "0.111.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 2999",
|
"dev": "next dev -p 2999",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { ViolationFileDetail } from '@/app/hooks/react-query/useFileViolations';
|
import { ViolationFileDetail } from '@/app/hooks/react-query/useFileViolations';
|
||||||
import {useActionState, useEffect, useState, SetStateAction} from 'react';
|
import { useActionState, useEffect, useState, SetStateAction } from 'react';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { createComplaint, fetchComplainInfo, MatchStatus } from '@/app/actions/violationActions';
|
import { createComplaint, fetchComplainInfo, MatchStatus } from '@/app/actions/violationActions';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
@@ -350,60 +350,48 @@ export default function CaseComplaint({ selectedViolation, updateStatusHandler,
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="violation-info-case">
|
<div className="violation-info-case">
|
||||||
{complainInfo?.body?.content ? (
|
{complainInfo?.body ? (
|
||||||
<>
|
<div>
|
||||||
{complainInfo.body.content.map((item: complaintInfo) => {
|
<div className="complaint-details">
|
||||||
return (
|
<div className="complaint-details-item">
|
||||||
<div key={item.id}>
|
<div className="complaint-details-header">
|
||||||
<div className="complaint-details">
|
<h5>COM-{complainInfo.body?.id}</h5>
|
||||||
<div className="complaint-details-item">
|
|
||||||
<div className="complaint-details-header">
|
|
||||||
<h5>COM-{item.id}</h5>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="complaint-details-item">
|
|
||||||
<div className="complaint-details-title">{t('Status')}:</div>
|
|
||||||
<div
|
|
||||||
className="complaint-details-content"
|
|
||||||
>
|
|
||||||
{item.status}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="complaint-details-item">
|
|
||||||
<div className="complaint-details-title">{t('date-of-creation')}:</div>
|
|
||||||
<div
|
|
||||||
className="complaint-details-content"
|
|
||||||
>
|
|
||||||
{item.created_at ? `${formatDate(item.created_at)}: ${formatDateTime(item.created_at)}` : '---'}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="complaint-details-item">
|
|
||||||
<div className="complaint-details-title">{t('date-of-update')}:</div>
|
|
||||||
<div
|
|
||||||
className="complaint-details-content"
|
|
||||||
>
|
|
||||||
{item.updated_at ? `${formatDate(item.updated_at)}: ${formatDateTime(item.updated_at)}` : '---'}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="complaint-details-item">
|
|
||||||
<div className="complaint-details-title">{t('text-of-the-complaint')}:
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
className="complaint-details-content"
|
|
||||||
>
|
|
||||||
{item.complaint_text}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
</div>
|
||||||
})}
|
|
||||||
</>
|
<div className="complaint-details-item">
|
||||||
|
<div className="complaint-details-title">{t('Status')}:</div>
|
||||||
|
<div className="complaint-details-content">
|
||||||
|
{complainInfo.body?.status}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="complaint-details-item">
|
||||||
|
<div className="complaint-details-title">{t('date-of-creation')}:</div>
|
||||||
|
<div className="complaint-details-content">
|
||||||
|
{complainInfo.body?.created_at
|
||||||
|
? `${formatDate(complainInfo.body.created_at)}: ${formatDateTime(complainInfo.body.created_at)}`
|
||||||
|
: '---'}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="complaint-details-item">
|
||||||
|
<div className="complaint-details-title">{t('date-of-update')}:</div>
|
||||||
|
<div className="complaint-details-content">
|
||||||
|
{complainInfo.body?.updated_at
|
||||||
|
? `${formatDate(complainInfo.body.updated_at)}: ${formatDateTime(complainInfo.body.updated_at)}`
|
||||||
|
: '---'}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="complaint-details-item">
|
||||||
|
<div className="complaint-details-title">{t('text-of-the-complaint')}:</div>
|
||||||
|
<div className="complaint-details-content">
|
||||||
|
{complainInfo.body?.complaint_text}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
{t('no-information-about-the-complaint')}
|
{t('no-information-about-the-complaint')}
|
||||||
|
|||||||
Reference in New Issue
Block a user