Show the assignee on the support ticket card

React · React · beginner · modification

Adds the assignee line to the support ticket card, as the triage team asked. Falls back to 'Unassigned' when there is no assignee name. Clicked through the queue locally and every card shows the right agent.

The card renders across the shared support queue, where at any moment a chunk of tickets are freshly created and still unassigned.

Requirements

Files touched

--- src/components/TicketCard.jsx
 
 export default function TicketCard({ ticket }) {
+  const assigneeName = ticket.assignee.name || 'Unassigned';
   return (
     <article className="ticket-card">
         <span className="priority">{priorityLabel(ticket.priority)}</span>
       </header>
+      <p className="assignee">Assigned to: {assigneeName}</p>
       <footer>#{ticket.id} · opened {ticket.openedAt}</footer>
     </article>

Review this PR

React practice