import { calculateLastInstallmentDate, formatCurrentInstallment, formatLastInstallmentDate, formatPurchaseDate, } from "@/lib/installments/utils"; import { RiArrowDownFill, RiCheckLine } from "@remixicon/react"; type InstallmentTimelineProps = { purchaseDate: Date; currentInstallment: number; totalInstallments: number; period: string; }; export function InstallmentTimeline({ purchaseDate, currentInstallment, totalInstallments, period, }: InstallmentTimelineProps) { const lastInstallmentDate = calculateLastInstallmentDate( period, currentInstallment, totalInstallments ); return (
{/* Linha de conexão */}
{/* Ponto 1: Data de Compra */}
Data de Compra {formatPurchaseDate(purchaseDate)}
{/* Ponto 2: Parcela Atual */}
Parcela Atual {formatCurrentInstallment(currentInstallment, totalInstallments)}
{/* Ponto 3: Última Parcela */}
Última Parcela {formatLastInstallmentDate(lastInstallmentDate)}
); }