diff --git a/client/src/pages/TicketDetail.tsx b/client/src/pages/TicketDetail.tsx index 485ad0d..7dd51e0 100644 --- a/client/src/pages/TicketDetail.tsx +++ b/client/src/pages/TicketDetail.tsx @@ -78,6 +78,7 @@ export default function TicketDetail() { const [editingSeverity, setEditingSeverity] = useState(false) const [editingAssignee, setEditingAssignee] = useState(false) const [expandedDates, setExpandedDates] = useState>(new Set()) + const [expandedCommentDates, setExpandedCommentDates] = useState>(new Set()) const toggleDate = (key: string) => setExpandedDates((prev) => { @@ -86,6 +87,13 @@ export default function TicketDetail() { return next }) + const toggleCommentDate = (id: string) => + setExpandedCommentDates((prev) => { + const next = new Set(prev) + next.has(id) ? next.delete(id) : next.add(id) + return next + }) + const isAdmin = authUser?.role === 'ADMIN' useEffect(() => { @@ -313,107 +321,110 @@ export default function TicketDetail() { {/* ── Comments ── */} {tab === 'comments' && ( -
+
{ticket.comments && ticket.comments.length > 0 ? ( -
- {ticket.comments.map((comment) => ( -
-
- -
-
-
- - {comment.author.displayName} - - - {format(new Date(comment.createdAt), 'MMM d, yyyy · HH:mm')} - -
- {(comment.authorId === authUser?.id || isAdmin) && ( - - )} -
-
- - {comment.body} - -
+ ticket.comments.map((comment, i) => ( +
+ {/* Avatar + spine */} +
+ + {i < (ticket.comments!.length - 1) && ( +
+ )} +
+ {/* Card */} +
+
+
+ + {comment.author.displayName} + +
+ {(comment.authorId === authUser?.id || isAdmin) && ( + + )} +
+
+ + {comment.body} +
- ))} -
+
+ )) ) : ( -
+
No comments yet
)} - {/* Comment composer */} -
-
- -
-
- {(['Write', 'Preview'] as const).map((label) => ( - - ))} -
- -
- {preview ? ( -
- {commentBody.trim() - ? {commentBody} - : Nothing to preview - } -
- ) : ( -