diff --git a/apps/link/app/(main)/tickets/[id]/@detail/_components/TicketDetail.tsx b/apps/link/app/(main)/tickets/[id]/@detail/_components/TicketDetail.tsx index 88896d5..e4d0b03 100644 --- a/apps/link/app/(main)/tickets/[id]/@detail/_components/TicketDetail.tsx +++ b/apps/link/app/(main)/tickets/[id]/@detail/_components/TicketDetail.tsx @@ -113,7 +113,12 @@ export const TicketDetail: FC = ({ id }) => { ).toLocaleDateString()})`} - {ticketArticles.edges.map(({ node: article }: any) => ( + {ticketArticles.edges.map(({ node: article }: any, index: number) => { + const thisDate = new Date(ticketArticles.edges[index].node.updatedAt).toLocaleDateString(); + const lastDate = index > 0 ? new Date(ticketArticles.edges[index - 1].node.updatedAt).toLocaleDateString() : "" + return ( + <> + {thisDate !== lastDate ? ({thisDate}) : (null)} = ({ id }) => { article.sender === "Agent" ? "outgoing" : "incoming" } /> - ))} + + )})}