diff --git a/src/components/admin/alerts/admin-alerts-manager.tsx b/src/components/admin/alerts/admin-alerts-manager.tsx index 8484f02..a443a8d 100644 --- a/src/components/admin/alerts/admin-alerts-manager.tsx +++ b/src/components/admin/alerts/admin-alerts-manager.tsx @@ -17,10 +17,12 @@ export function AdminAlertsManager() { const [range, setRange] = useState("30d") const { session, convexUserId } = useAuth() const tenantId = session?.user.tenantId ?? DEFAULT_TENANT_ID - const now = new Date() - const days = range === "7d" ? 7 : range === "30d" ? 30 : range === "90d" ? 90 : null - const end = now.getTime() - const start = days ? end - days * 24 * 60 * 60 * 1000 : undefined + const { start, end } = useMemo(() => { + const daysLocal = range === "7d" ? 7 : range === "30d" ? 30 : range === "90d" ? 90 : null + const endLocal = Date.now() + const startLocal = daysLocal ? endLocal - daysLocal * 24 * 60 * 60 * 1000 : undefined + return { start: startLocal, end: endLocal } + }, [range]) const alertsRaw = useQuery( api.alerts.list, diff --git a/src/components/tickets/ticket-summary-header.tsx b/src/components/tickets/ticket-summary-header.tsx index 171193c..8a8f3a1 100644 --- a/src/components/tickets/ticket-summary-header.tsx +++ b/src/components/tickets/ticket-summary-header.tsx @@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useState } from "react" import { format, formatDistanceToNow } from "date-fns" import { ptBR } from "date-fns/locale" -import { IconClock, IconFileTypePdf, IconPlayerPause, IconPlayerPlay } from "@tabler/icons-react" +import { IconClock, IconDownload, IconInfoCircle, IconPlayerPause, IconPlayerPlay } from "@tabler/icons-react" import { useMutation, useQuery } from "convex/react" import { toast } from "sonner" import { api } from "@/convex/_generated/api" @@ -30,6 +30,7 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" +import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" interface TicketHeaderProps { ticket: TicketWithDetails @@ -447,19 +448,6 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) { return (
- {workSummary ? ( - <> - - Interno: {formatDuration(internalWorkedMs)} - - - Externo: {formatDuration(externalWorkedMs)} - - - Total: {formattedTotalWorked} - - - ) : null} {!editing ? ( + {workSummary ? ( +
+ + Tempo total: {formattedTotalWorked} + + + + + + +
+ Horas internas: {formatDuration(internalWorkedMs)} + Horas externas: {formatDuration(externalWorkedMs)} +
+
+
+
+ ) : null} } />
diff --git a/src/components/tickets/tickets-table.tsx b/src/components/tickets/tickets-table.tsx index 1ca1ee1..1f72e01 100644 --- a/src/components/tickets/tickets-table.tsx +++ b/src/components/tickets/tickets-table.tsx @@ -145,12 +145,12 @@ export function TicketsTable({ tickets = ticketsMock }: TicketsTableProps) { Fila - - Empresa - Canal + + Empresa + Prioridade