refactor: agrega queries e cache do dashboard

This commit is contained in:
Felipe Coutinho
2026-03-20 18:38:20 +00:00
parent 5b8d25d894
commit 41fd8226cb
24 changed files with 1648 additions and 690 deletions

View File

@@ -95,7 +95,7 @@ const getPercentChange = (current: number, previous: number): string => {
};
const getTrendBadgeClass = (trend: Trend, invertTrend: boolean): string => {
if (trend === "flat") return "bg-muted text-muted-foreground";
if (trend === "flat") return "text-muted-foreground";
const isPositive = invertTrend ? trend === "down" : trend === "up";
return isPositive ? "text-success" : "text-destructive";
};
@@ -120,10 +120,7 @@ export function DashboardMetricsCards({ metrics }: DashboardMetricsCardsProps) {
<div className="flex items-start justify-between">
<div>
<CardTitle className="flex items-center gap-1 tracking-tight">
<Icon
className={cn("size-4", iconClass)}
aria-hidden
/>
<Icon className={cn("size-4", iconClass)} aria-hidden />
{label}
</CardTitle>
<CardDescription className="mt-1.5 tracking-tight">

View File

@@ -38,7 +38,7 @@ export function InstallmentAnalysisPage({
return allInstallmentsSelected && data.installmentGroups.length > 0;
}, [selectedInstallments, data]);
// Função para selecionar/desselecionar tudo
// Função para selecionar/desmarcar tudo
const toggleSelectAll = () => {
if (isAllSelected) {
// Desmarcar tudo
@@ -59,7 +59,7 @@ export function InstallmentAnalysisPage({
}
};
// Função para selecionar/desselecionar um grupo de parcelas
// Função para selecionar/desmarcar um grupo de parcelas
const toggleGroupSelection = (seriesId: string, installmentIds: string[]) => {
const newMap = new Map(selectedInstallments);
const current = newMap.get(seriesId) || new Set<string>();
@@ -75,7 +75,7 @@ export function InstallmentAnalysisPage({
setSelectedInstallments(newMap);
};
// Função para selecionar/desselecionar parcela individual
// Função para selecionar/desmarcar parcela individual
const toggleInstallmentSelection = (
seriesId: string,
installmentId: string,

View File

@@ -69,7 +69,7 @@ export function InvoiceListItem({ invoice, onPay }: InvoiceListItemProps) {
<HoverCard openDelay={150}>
<HoverCardTrigger asChild>{linkNode}</HoverCardTrigger>
<HoverCardContent align="start" className="w-72 space-y-3">
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
<p className="text-xs text-muted-foreground">
Distribuição por pagador
</p>
<ul className="space-y-2">