"use client"; import { RiCheckboxCircleLine, RiHourglass2Line, RiWallet3Line, } from "@remixicon/react"; import MoneyValues from "@/components/money-values"; import { CardContent } from "@/components/ui/card"; import { WidgetEmptyState } from "@/components/widget-empty-state"; import type { PaymentStatusData } from "@/lib/dashboard/payments/payment-status"; import { Progress } from "../ui/progress"; type PaymentStatusWidgetProps = { data: PaymentStatusData; }; type CategorySectionProps = { title: string; total: number; confirmed: number; pending: number; }; function CategorySection({ title, total, confirmed, pending, }: CategorySectionProps) { // Usa valores absolutos para calcular percentual corretamente const absTotal = Math.abs(total); const absConfirmed = Math.abs(confirmed); const confirmedPercentage = absTotal > 0 ? (absConfirmed / absTotal) * 100 : 0; return (
{title}
{/* Barra de progresso */} {/* Status de confirmados e pendentes */}
confirmados
pendentes
); } export function PaymentStatusWidget({ data }: PaymentStatusWidgetProps) { const isEmpty = data.income.total === 0 && data.expenses.total === 0; if (isEmpty) { return ( } title="Nenhum valor a receber ou pagar no período" description="Registre lançamentos para visualizar os valores confirmados e pendentes." /> ); } return ( {/* Linha divisória pontilhada */}
); }