diff --git a/frontend/src/components/procurement/ProcurementRequestDetailContent.tsx b/frontend/src/components/procurement/ProcurementRequestDetailContent.tsx index 144b047d..9ce8a9e9 100644 --- a/frontend/src/components/procurement/ProcurementRequestDetailContent.tsx +++ b/frontend/src/components/procurement/ProcurementRequestDetailContent.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import Link from "next/link"; -import { Check, CheckCircle2, CircleDot, ExternalLink, MessageSquare, Plus, Save, X } from "lucide-react"; +import { Check, CheckCircle2, CircleDot, ExternalLink, MessageSquare, Plus, Save, SlidersHorizontal, X } from "lucide-react"; import { RequestAvatar } from "@/components/requests/RequestAvatar"; import { CommentComposer, CommentDeleteButton } from "@/components/shared/CommentControls"; @@ -115,6 +115,7 @@ function ProcurementItemCard({ onDeleteComment, }: ProcurementItemCardProps) { const [draft, setDraft] = useState(() => normalizeItemDraft(item)); + const [processingOpen, setProcessingOpen] = useState(false); const links = Array.isArray(item.links) ? item.links.filter(Boolean) : []; const commentsTotal = item.comments_count ?? comments.length; @@ -174,64 +175,77 @@ function ProcurementItemCard({ Статус: {item.execution_status_display || "Не выполнено"} {item.expected_delivery_date ? Ожидается: {formatDate(item.expected_delivery_date)} : null} -
- +
+
+ +
- {commentsOpen ? ( -
- {comments.length === 0 ? ( -

Комментариев по позиции пока нет

- ) : ( - comments.map((comment) => { - const canDeleteComment = Boolean( - canDeleteAnyComment || (comment.author?.id && currentUserId === comment.author.id), - ); - - return ( -
-
- - {displayUserName(comment.author)} - -
- {formatDate(comment.created_at)} - {canDeleteComment ? ( - onDeleteComment?.(requestId, item.id, comment.id)} - /> - ) : null} -
-
-

{comment.text}

-
- ); - }) - )} - onCommentDraftChange?.(item.id, value)} - onSubmit={() => onAddComment?.(requestId, item.id)} - disabled={busyKey === `item-comment-${item.id}`} - placeholder="Комментарий по позиции" - /> -
+ {canEditItemProcessing ? ( + ) : null}
- {canEditItemProcessing ? ( + {commentsOpen ? ( +
+ {comments.length === 0 ? ( +

Комментариев по позиции пока нет

+ ) : ( + comments.map((comment) => { + const canDeleteComment = Boolean( + canDeleteAnyComment || (comment.author?.id && currentUserId === comment.author.id), + ); + + return ( +
+
+ + {displayUserName(comment.author)} + +
+ {formatDate(comment.created_at)} + {canDeleteComment ? ( + onDeleteComment?.(requestId, item.id, comment.id)} + /> + ) : null} +
+
+

{comment.text}

+
+ ); + }) + )} + onCommentDraftChange?.(item.id, value)} + onSubmit={() => onAddComment?.(requestId, item.id)} + disabled={busyKey === `item-comment-${item.id}`} + placeholder="Комментарий по позиции" + /> +
+ ) : null} + + {canEditItemProcessing && processingOpen ? (