refactor: remover código morto e exports não utilizados

Remove 6 componentes não utilizados (dashboard-grid, expenses/income
by category widgets, installment analysis panels, fatura-warning-dialog).

Remove funções/tipos não utilizados: successResult, generateApiToken,
validateApiToken, getTodayUTC/Local, formatDateForDb, getDateInfo,
calculatePercentage, roundToDecimals, safeParseInt/Float, isPeriodValid,
getLastPeriods, normalizeWhitespace, formatCurrency wrapper,
InboxItemInput, InboxBatchInput, ProcessInboxInput, DiscardInboxInput,
LancamentosColumnId, 5 funções de anticipation-helpers.

Redireciona imports de formatCurrency para lib/lancamentos/formatting-helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Felipe Coutinho
2026-02-26 17:19:33 +00:00
parent c7eabc513e
commit 8de22b9930
22 changed files with 8 additions and 1014 deletions

View File

@@ -1,84 +0,0 @@
"use client";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { MONTH_NAMES } from "@/lib/utils/period";
export type FaturaWarning = {
nextPeriod: string;
cardName: string;
isPaid: boolean;
isAfterClosing: boolean;
closingDay: string | null;
currentPeriod: string;
};
export function formatPeriodDisplay(period: string): string {
const [yearStr, monthStr] = period.split("-");
const monthIndex = Number.parseInt(monthStr ?? "1", 10) - 1;
const monthName = MONTH_NAMES[monthIndex] ?? monthStr;
return `${monthName}/${yearStr}`;
}
function buildWarningMessage(warning: FaturaWarning): string {
const currentDisplay = formatPeriodDisplay(warning.currentPeriod);
if (warning.isPaid && warning.isAfterClosing) {
return `A fatura do ${warning.cardName} em ${currentDisplay} já está paga e fechou no dia ${warning.closingDay}.`;
}
if (warning.isPaid) {
return `A fatura do ${warning.cardName} em ${currentDisplay} já está paga.`;
}
return `A fatura do ${warning.cardName} fechou no dia ${warning.closingDay}.`;
}
interface FaturaWarningDialogProps {
warning: FaturaWarning | null;
onConfirm: (nextPeriod: string) => void;
onCancel: () => void;
}
export function FaturaWarningDialog({
warning,
onConfirm,
onCancel,
}: FaturaWarningDialogProps) {
if (!warning) return null;
return (
<AlertDialog
open
onOpenChange={(open) => {
if (!open) onCancel();
}}
>
<AlertDialogContent className="sm:max-w-md">
<AlertDialogHeader>
<AlertDialogTitle>Fatura indisponível</AlertDialogTitle>
<AlertDialogDescription>
{buildWarningMessage(warning)} Deseja registrá-lo em{" "}
<span className="font-medium text-foreground">
{formatPeriodDisplay(warning.nextPeriod)}
</span>
?
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter className="flex-col gap-2 sm:flex-col">
<AlertDialogAction onClick={() => onConfirm(warning.nextPeriod)}>
Mover para {formatPeriodDisplay(warning.nextPeriod)}
</AlertDialogAction>
<AlertDialogCancel onClick={onCancel}>
Manter em {formatPeriodDisplay(warning.currentPeriod)}
</AlertDialogCancel>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
}