diff --git a/src/components/tickets/recent-tickets-panel.tsx b/src/components/tickets/recent-tickets-panel.tsx index bb2e2ac..b630d02 100644 --- a/src/components/tickets/recent-tickets-panel.tsx +++ b/src/components/tickets/recent-tickets-panel.tsx @@ -10,16 +10,13 @@ import type { Id } from "@/convex/_generated/dataModel" import { DEFAULT_TENANT_ID } from "@/lib/constants" import { mapTicketsFromServerList } from "@/lib/mappers/ticket" import type { Ticket } from "@/lib/schemas/ticket" -import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Skeleton } from "@/components/ui/skeleton" import { TicketPriorityPill } from "@/components/tickets/priority-pill" import { TicketStatusBadge } from "@/components/tickets/status-badge" import { useAuth } from "@/lib/auth-client" - -const metaBadgeClass = - "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-[11px] font-semibold text-neutral-700" +import { cn } from "@/lib/utils" const channelLabel: Record = { EMAIL: "E-mail", @@ -31,49 +28,54 @@ const channelLabel: Record = { } function TicketRow({ ticket, entering }: { ticket: Ticket; entering: boolean }) { + const channel = channelLabel[ticket.channel] ?? ticket.channel + const queueLabel = ticket.queue ?? "Sem fila" + const requesterName = ticket.requester.name ?? ticket.requester.email ?? "Solicitante" + return (
-
+
-
- #{ticket.reference} - - {ticket.queue ?? "Sem fila"} - +
+
+ #{ticket.reference} + + {queueLabel} + +
+
- + {ticket.subject} -

{ticket.summary ?? "Sem resumo"}

+

{ticket.summary ?? "Sem descrição informada."}

- {ticket.requester.name} + {requesterName} {formatDistanceToNow(ticket.updatedAt, { addSuffix: true, locale: ptBR })}
- {ticket.category ? ( - - {ticket.category.name} - {ticket.subcategory ? ` • ${ticket.subcategory.name}` : ""} - - ) : ( - - Sem categoria - - )} +
+ {channel} + + {ticket.assignee?.name ?? "Sem responsável"} + + {ticket.category ? ( + + {ticket.category.name} + {ticket.subcategory ? ` · ${ticket.subcategory.name}` : ""} + + ) : null} +
-
-
- - -
-
- {channelLabel[ticket.channel] ?? ticket.channel} - {ticket.assignee?.name ?? "Sem responsável"} -
+
+