style: rename support queues and align category badges

This commit is contained in:
esdrasrenan 2025-10-05 00:28:45 -03:00
parent fcac720f83
commit dee31117d3
5 changed files with 23 additions and 28 deletions

View file

@ -10,8 +10,8 @@ export const ensureDefaults = mutation({
.collect();
if (existing.length === 0) {
const queues = [
{ name: "Suporte N1", slug: "suporte-n1" },
{ name: "Suporte N2", slug: "suporte-n2" },
{ name: "Chamados", slug: "chamados" },
{ name: "Laboratório", slug: "laboratorio" },
{ name: "Field Services", slug: "field-services" },
];
for (const q of queues) {

View file

@ -13,8 +13,8 @@ export const seedDemo = mutation({
? existingQueues
: await Promise.all(
[
{ name: "Suporte N1", slug: "suporte-n1" },
{ name: "Suporte N2", slug: "suporte-n2" },
{ name: "Chamados", slug: "chamados" },
{ name: "Laboratório", slug: "laboratorio" },
].map((q) => ctx.db.insert("queues", { tenantId, name: q.name, slug: q.slug, teamId: undefined }))
).then((ids) => Promise.all(ids.map((id) => ctx.db.get(id))))
;

View file

@ -35,7 +35,6 @@ const channelLabel: Record<string, string> = {
const cellClass = "px-6 py-5 align-top text-sm text-neutral-700 first:pl-8 last:pr-8"
const queueBadgeClass = "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-neutral-700"
const channelBadgeClass = "inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-neutral-700"
const tagBadgeClass = "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-2.5 py-0.5 text-[11px] font-medium text-neutral-600"
const categoryBadgeClass = "inline-flex items-center gap-1 rounded-full border border-[#00e8ff]/50 bg-[#00e8ff]/10 px-2.5 py-0.5 text-[11px] font-semibold text-[#02414d]"
const tableRowClass = "group border-b border-slate-100 text-sm transition-colors hover:bg-slate-100/70 last:border-none"
@ -170,17 +169,13 @@ export function TicketsTable({ tickets = ticketsMock }: TicketsTableProps) {
</span>
<div className="flex flex-wrap items-center gap-2 text-xs text-neutral-500">
<span className="font-semibold text-neutral-700">{ticket.requester.name}</span>
{ticket.category ? (
<Badge className={categoryBadgeClass}>
{ticket.category.name}
{ticket.subcategory ? `${ticket.subcategory.name}` : ""}
</Badge>
) : null}
{ticket.tags?.map((tag) => (
<Badge key={tag} className={tagBadgeClass}>
{tag}
</Badge>
))}
<Badge
className={categoryBadgeClass}
>
{ticket.category
? `${ticket.category.name}${ticket.subcategory ? `${ticket.subcategory.name}` : ""}`
: "Sem categoria"}
</Badge>
</div>
</div>
</TableCell>

View file

@ -35,7 +35,7 @@ describe("ticket mappers", () => {
status: "OPEN",
priority: "MEDIUM",
channel: "EMAIL",
queue: "Suporte N1",
queue: "Chamados",
requester: { id: "u1", name: "Ana", email: "a@a.com", teams: [] },
assignee: { id: "u2", name: "Bruno", email: "b@b.com", teams: [] },
updatedAt: now,

View file

@ -22,21 +22,21 @@ const users: Record<string, UserRecord> = {
name: "Ana Souza",
email: "ana.souza@example.com",
avatarUrl: "https://avatar.vercel.sh/ana",
teams: ["Suporte N1"],
teams: ["Chamados"],
},
bruno: {
id: "user-bruno",
name: "Bruno Lima",
email: "bruno.lima@example.com",
avatarUrl: "https://avatar.vercel.sh/bruno",
teams: ["Suporte N1"],
teams: ["Chamados"],
},
carla: {
id: "user-carla",
name: "Carla Menezes",
email: "carla.menezes@example.com",
avatarUrl: "https://avatar.vercel.sh/carla",
teams: ["Suporte N2"],
teams: ["Laboratório"],
},
diego: {
id: "user-diego",
@ -54,9 +54,9 @@ const users: Record<string, UserRecord> = {
},
}
const queues = [
{ id: "queue-suporte-n1", name: "Suporte N1", pending: 18, waiting: 4, breached: 2 },
{ id: "queue-suporte-n2", name: "Suporte N2", pending: 9, waiting: 3, breached: 1 },
const queues = [
{ id: "queue-chamados", name: "Chamados", pending: 18, waiting: 4, breached: 2 },
{ id: "queue-laboratorio", name: "Laboratório", pending: 9, waiting: 3, breached: 1 },
{ id: "queue-field", name: "Field Services", pending: 5, waiting: 2, breached: 0 },
]
@ -70,7 +70,7 @@ const baseTickets = [
status: ticketStatusSchema.enum.OPEN,
priority: ticketPrioritySchema.enum.URGENT,
channel: ticketChannelSchema.enum.EMAIL,
queue: "Suporte N1",
queue: "Chamados",
requester: users.eduarda,
assignee: users.ana,
slaPolicy: {
@ -100,7 +100,7 @@ const baseTickets = [
status: ticketStatusSchema.enum.PENDING,
priority: ticketPrioritySchema.enum.HIGH,
channel: ticketChannelSchema.enum.WHATSAPP,
queue: "Suporte N2",
queue: "Laboratório",
requester: users.eduarda,
assignee: users.carla,
slaPolicy: {
@ -130,7 +130,7 @@ const baseTickets = [
status: ticketStatusSchema.enum.NEW,
priority: ticketPrioritySchema.enum.MEDIUM,
channel: ticketChannelSchema.enum.MANUAL,
queue: "Field Services",
queue: "Field Services",
requester: users.eduarda,
assignee: null,
slaPolicy: null,
@ -151,7 +151,7 @@ const baseTickets = [
status: ticketStatusSchema.enum.ON_HOLD,
priority: ticketPrioritySchema.enum.HIGH,
channel: ticketChannelSchema.enum.CHAT,
queue: "Suporte N2",
queue: "Laboratório",
requester: users.eduarda,
assignee: users.carla,
slaPolicy: {
@ -181,7 +181,7 @@ const baseTickets = [
status: ticketStatusSchema.enum.RESOLVED,
priority: ticketPrioritySchema.enum.MEDIUM,
channel: ticketChannelSchema.enum.EMAIL,
queue: "Suporte N1",
queue: "Chamados",
requester: users.eduarda,
assignee: users.bruno,
slaPolicy: {