import { RiBarcodeLine } from "@remixicon/react"; import MoneyValues from "@/components/money-values"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { WidgetEmptyState } from "@/components/widget-empty-state"; import type { PagadorBoletoStats } from "@/lib/pagadores/details"; import { cn } from "@/lib/utils/ui"; type PagadorBoletoCardProps = { stats: PagadorBoletoStats; }; export function PagadorBoletoCard({ stats }: PagadorBoletoCardProps) { const total = stats.totalAmount; const paidPercent = total > 0 ? Math.round((stats.paidAmount / total) * 100) : 0; const pendingPercent = total > 0 ? Math.round((stats.pendingAmount / total) * 100) : 0; return ( Boletos

Totais por status considerando o período atual.

{total === 0 ? ( } title="Nenhum lançamento com boleto" description="Quando houver despesas registradas com boleto, elas aparecerão aqui." /> ) : ( <>
Total de boletos
)}
); } type StatusRowProps = { label: string; amount: number; count: number; percent: number; tone: "success" | "warning"; }; function StatusRow({ label, amount, count, percent, tone }: StatusRowProps) { const clampedPercent = Math.min(Math.max(percent, 0), 100); return (
{label} {count} registros
{clampedPercent}% do total
); }