import { RiArrowDownLine, RiArrowUpLine } from "@remixicon/react"; import StatusDot from "@/shared/components/feedback/status-dot"; import MoneyValues from "@/shared/components/money-values"; import { Progress } from "@/shared/components/ui/progress"; import { formatPercentage } from "@/shared/utils/percentage"; type PaymentStatusCategorySectionProps = { type: "income" | "expenses"; total: number; confirmed: number; pending: number; }; export function PaymentStatusCategorySection({ type, total, confirmed, pending, }: PaymentStatusCategorySectionProps) { const absTotal = Math.abs(total); const absConfirmed = Math.abs(confirmed); const confirmedPercentage = absTotal > 0 ? (absConfirmed / absTotal) * 100 : 0; const income = type === "income"; const title = income ? "A receber" : "A pagar"; const confirmedLabel = income ? "recebidos" : "pagos"; const pendingLabel = income ? "a receber" : "a pagar"; const percentageLabel = income ? "recebido" : "pago"; const TitleIcon = income ? RiArrowDownLine : RiArrowUpLine; return (