style: restyle ticket details panel

This commit is contained in:
Esdras Renan 2025-10-20 19:54:36 -03:00
parent 3972f66c92
commit 96a6f73e30
2 changed files with 227 additions and 90 deletions

View file

@ -157,7 +157,6 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
useQuery(queuesEnabled ? api.queues.summary : "skip", queueArgs) as TicketQueueSummary[] | undefined
) ?? []
const { categories, isLoading: categoriesLoading } = useTicketCategories(ticket.tenantId)
const [status] = useState<TicketStatus>(ticket.status)
const workSummaryRemote = useQuery(
api.tickets.workSummary,
convexUserId
@ -595,8 +594,8 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
sessionId?: Id<"ticketWorkSessions">
serverNow?: number
}
const status = resultMeta?.status ?? "started"
if (status === "already_started") {
const startStatus = resultMeta?.status ?? "started"
if (startStatus === "already_started") {
toast.info("O atendimento já estava em andamento", { id: "work" })
} else {
toast.success("Atendimento iniciado", { id: "work" })
@ -608,7 +607,7 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
typeof startedAtMsRaw === "number" && Number.isFinite(startedAtMsRaw) ? startedAtMsRaw : getServerNow()
if (typeof startedAtMsRaw === "number") {
localStartOriginRef.current = "remote"
} else if (status === "already_started") {
} else if (startStatus === "already_started") {
localStartOriginRef.current = "already-running-fallback"
} else {
localStartOriginRef.current = "fresh-local"