hide AUTHORIZED_USE and NOT_OWNER_FILE button while match in work
This commit is contained in:
@@ -18,6 +18,8 @@ import { createPortal } from 'react-dom';
|
||||
import { IconContentCopy, IconFollowToLink, IconFullScreen } from '@/app/ui/icons/icons';
|
||||
import { useViewport } from '@/app/hooks/useViewport';
|
||||
|
||||
const IN_WORK_STATUS = ['COMPLAINT_AND_LEGAL_IN_WORK', 'LEGAL_IN_WORK', 'COMPLAINT_IN_WORK'];
|
||||
|
||||
export default function FilePageViolationInfo(
|
||||
{
|
||||
selectedViolation,
|
||||
@@ -68,7 +70,6 @@ export default function FilePageViolationInfo(
|
||||
queryClient.invalidateQueries({ queryKey: ['lastCases'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['lastComplaints'] });
|
||||
|
||||
|
||||
if (status === 'NOT_OWNER_FILE') {
|
||||
console.log('NOT_OWNER_FILE');
|
||||
setLocalViolation(null);
|
||||
@@ -333,28 +334,33 @@ export default function FilePageViolationInfo(
|
||||
<div
|
||||
className="violation-info-action"
|
||||
>
|
||||
<button
|
||||
className="btn-s btn-no-my-file"
|
||||
onClick={() => {
|
||||
if (selectedViolation?.id) {
|
||||
updateStatusHandler(selectedViolation.id, 'NOT_OWNER_FILE');
|
||||
}
|
||||
}}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
{tStatus('NOT_OWNER_FILE')}
|
||||
</button>
|
||||
<button
|
||||
className="btn-s btn-resolve"
|
||||
onClick={() => {
|
||||
if (selectedViolation?.id) {
|
||||
updateStatusHandler(selectedViolation.id, 'AUTHORIZED_USE');
|
||||
}
|
||||
}}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
{t('allow-use')}
|
||||
</button>
|
||||
{!IN_WORK_STATUS.includes(selectedViolation.status) && (
|
||||
<button
|
||||
className="btn-s btn-no-my-file"
|
||||
onClick={() => {
|
||||
if (selectedViolation?.id) {
|
||||
updateStatusHandler(selectedViolation.id, 'NOT_OWNER_FILE');
|
||||
}
|
||||
}}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
{tStatus('NOT_OWNER_FILE')}
|
||||
</button>
|
||||
)}
|
||||
|
||||
{!IN_WORK_STATUS.includes(selectedViolation.status) && (
|
||||
<button
|
||||
className="btn-s btn-resolve"
|
||||
onClick={() => {
|
||||
if (selectedViolation?.id) {
|
||||
updateStatusHandler(selectedViolation.id, 'AUTHORIZED_USE');
|
||||
}
|
||||
}}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
{t('allow-use')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -585,7 +585,7 @@
|
||||
"VERIFIED": "Верифицирован",
|
||||
"VERIFICATION_FAILED": "Верификация не удалась",
|
||||
"unknow": "Неизвестно",
|
||||
"user-verification": "Верификация юзера",
|
||||
"user-verification": "Верификация пользователя",
|
||||
"Status": "Статус"
|
||||
},
|
||||
"Countryes": {
|
||||
|
||||
Reference in New Issue
Block a user