chore(ui): finalize hour/date formatting rollout; adjust contracted hours display; clean up unused formatter
This commit is contained in:
parent
f255a4c780
commit
0a3e1a0130
2 changed files with 12 additions and 13 deletions
|
|
@ -64,14 +64,7 @@ export function HoursReport() {
|
|||
)
|
||||
}, [filtered])
|
||||
|
||||
const numberFormatter = useMemo(
|
||||
() =>
|
||||
new Intl.NumberFormat("pt-BR", {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}),
|
||||
[]
|
||||
)
|
||||
// No number formatter needed; we use formatHoursCompact for hours
|
||||
|
||||
const filteredWithComputed = useMemo(
|
||||
() =>
|
||||
|
|
@ -228,7 +221,7 @@ export function HoursReport() {
|
|||
<div className="flex items-center justify-between text-xs text-neutral-500">
|
||||
<span>Contratadas/mês</span>
|
||||
<span className="font-medium text-neutral-800">
|
||||
{row.contracted ? `${numberFormatter.format(row.contracted)} h` : "—"}
|
||||
{row.contracted ? formatHoursCompact(row.contracted) : "—"}
|
||||
</span>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@ import { Area, AreaChart, Bar, BarChart, CartesianGrid, XAxis } from "recharts"
|
|||
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"
|
||||
import { formatDateDM, formatDateDMY, formatHoursCompact } from "@/lib/utils"
|
||||
|
||||
const agentProductivityChartConfig = {
|
||||
resolved: {
|
||||
label: "Chamados resolvidos",
|
||||
},
|
||||
}
|
||||
|
||||
function formatMinutes(value: number | null) {
|
||||
if (value === null) return "—"
|
||||
if (value < 60) return `${value.toFixed(0)} min`
|
||||
|
|
@ -300,15 +306,15 @@ export function SlaReport() {
|
|||
<div className="grid gap-6 md:grid-cols-2">
|
||||
<div className="space-y-3">
|
||||
<p className="text-xs text-neutral-500">Resolvidos por agente</p>
|
||||
<ChartContainer config={{}} className="aspect-auto h-[260px] w-full">
|
||||
<ChartContainer config={agentProductivityChartConfig} className="aspect-auto h-[260px] w-full">
|
||||
<BarChart
|
||||
data={agents.items.slice(0, 10).map((a) => ({ name: a.name || a.email || 'Agente', resolved: a.resolved }))}
|
||||
margin={{ left: 12, right: 12, bottom: 28 }}
|
||||
margin={{ top: 8, left: 20, right: 20, bottom: 56 }}
|
||||
>
|
||||
<CartesianGrid vertical={false} />
|
||||
<XAxis dataKey="name" tickLine={false} axisLine={false} tickMargin={14} interval={0} angle={-30} height={68} />
|
||||
<XAxis dataKey="name" tickLine={false} axisLine={false} tickMargin={24} interval={0} angle={-30} height={80} />
|
||||
<Bar dataKey="resolved" fill="var(--chart-1)" radius={[4, 4, 0, 0]} />
|
||||
<ChartTooltip content={<ChartTooltipContent className="w-[180px]" nameKey="Resolvidos" />} />
|
||||
<ChartTooltip content={<ChartTooltipContent className="w-[180px]" nameKey="resolved" />} />
|
||||
</BarChart>
|
||||
</ChartContainer>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue