diff --git a/package.json b/package.json index fd22a55..a048211 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "no-copy-admin-panel-frontend", - "version": "0.16.0", + "version": "0.17.0", "private": true, "scripts": { "dev": "next dev -p 2996", diff --git a/src/app/hooks/react-query/useContentForModeration.ts b/src/app/hooks/react-query/useContentForModeration.ts index 74c206b..881374b 100644 --- a/src/app/hooks/react-query/useContentForModeration.ts +++ b/src/app/hooks/react-query/useContentForModeration.ts @@ -1,10 +1,21 @@ import { useQuery } from '@tanstack/react-query'; import { fetchModerationContentList } from '@/app/actions/contentActions'; +export interface AppealInfo { + additionalInfo: string | null; + adminComment: null; + appealId: string | null; + appealReason: string | null; + createdAt: string | null; + fileId: string | null; + fileName: string | null; + resolvedAt: string | null; + status: string; +} export interface ModerationFile { fileName: string; moderationInfo: { - appealInfo: null | any; + appealInfo: null | AppealInfo; hasActiveAppeal: boolean; }; userId: number; diff --git a/src/app/styles/file-moderation-modal.scss b/src/app/styles/file-moderation-modal.scss index 0a1b1fc..716ad52 100644 --- a/src/app/styles/file-moderation-modal.scss +++ b/src/app/styles/file-moderation-modal.scss @@ -125,6 +125,62 @@ cursor: not-allowed; } } + + .tabs-modal__header { + display: flex; + flex-direction: column; + gap: 1rem; + } + + .tabs-modal__tabs { + display: flex; + gap: 0.5rem; + border-bottom: 1px solid #e2e8f0; + padding-bottom: 0.5rem; + justify-content: space-between; + } + + .tabs-modal__tab { + padding: 0.5rem 1rem; + background: transparent; + border: none; + border-radius: 0.375rem; + cursor: pointer; + font-size: 0.875rem; + font-weight: 500; + color: #64748b; + transition: all 0.2s; + position: relative; + } + + .tabs-modal__tab:hover:not(:disabled) { + color: #3b82f6; + background: #f1f5f9; + } + + .tabs-modal__tab--active { + color: #3b82f6; + background: #eff6ff; + } + + .tabs-modal__tab--disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .tabs-modal__tab-badge { + display: inline-block; + margin-left: 0.5rem; + padding: 0.125rem 0.375rem; + background: #e2e8f0; + border-radius: 9999px; + font-size: 0.75rem; + font-weight: normal; + } + + .tabs-modal__content { + margin-top: 1rem; + } } .status-badge { diff --git a/src/app/styles/global-styles.scss b/src/app/styles/global-styles.scss index df41408..60223cd 100644 --- a/src/app/styles/global-styles.scss +++ b/src/app/styles/global-styles.scss @@ -1035,6 +1035,14 @@ } } + .table-status { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 5px; + } + .table-item-protected { color: #10b981; font-size: 12px; diff --git a/src/app/ui/content/AppealModerationModal.tsx b/src/app/ui/content/AppealModerationModal.tsx index 0a4f2c6..fb2c273 100644 --- a/src/app/ui/content/AppealModerationModal.tsx +++ b/src/app/ui/content/AppealModerationModal.tsx @@ -7,9 +7,10 @@ import DropDownList from '@/app/components/dropDownList'; import { AppealsFile } from '@/app/hooks/react-query/useContentForAppeals'; import { changeAppealContentStatus } from '@/app/actions/contentActions'; import { formatDate, formatDateTime } from '@/app/lib/formatDate'; +import { AppealInfo } from '@/app/hooks/react-query/useContentForModeration'; interface AppealModerationModalProps { - file: AppealsFile | null; + file: AppealInfo | AppealsFile | null; onClose: () => void; } @@ -100,96 +101,93 @@ export default function AppealModerationModal({ file, onClose }: AppealModeratio if (!file) return null; return ( -
-

Управление апелляцией

+ <> + {/* Информация о файле */} +
+ +

{file?.fileName ? file?.fileName : '---'}

+
-
- {/* Информация о файле */} -
- -

{file?.fileName ? file?.fileName : '---'}

-
+
+ + {/* @ts-ignore сейчас нету айди юзера возможно нужно будет удалить или добавить*/} +

{file?.userId ? file?.userId : '---'}

+
-
- - {/* @ts-ignore сейчас нету айди юзера возможно нужно будет удалить или добавить*/} -

{file?.userId ? file?.userId : '---'}

-
+
+ +

{file.appealReason}

+
-
- -

{file.appealReason}

-
+
+ +

{file.additionalInfo || '—'}

+
-
- -

{file.additionalInfo || '—'}

-
+
+ +

+ {file.createdAt && ( + `${formatDate(file.createdAt)}, ${formatDateTime(file.createdAt)}` + )} +

+
+ {file.resolvedAt && (
- +

- {formatDate(file.createdAt)}, {formatDateTime(file.createdAt)} + {formatDate(file.resolvedAt)}, {formatDateTime(file.resolvedAt)}

+ )} - {file.resolvedAt && ( -
- -

- {formatDate(file.resolvedAt)}, {formatDateTime(file.resolvedAt)} -

-
- )} - -
- - -
- - {/* Комментарий администратора */} -
- -