diff --git a/app/(dashboard)/categorias/loading.tsx b/app/(dashboard)/categorias/loading.tsx index 5ecb500..044b0b1 100644 --- a/app/(dashboard)/categorias/loading.tsx +++ b/app/(dashboard)/categorias/loading.tsx @@ -1,3 +1,4 @@ +import { Card, CardContent } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; export default function CategoriasLoading() { @@ -21,32 +22,40 @@ export default function CategoriasLoading() { ))} - {/* Grid de cards de categorias */} -
- {selectedBoleto.name} -
++ Boleto +
++ {selectedBoleto.name} +
+- {selectedBoletoDueLabel} -
++ {selectedBoletoDueLabel} +
+{formattedDate}
diff --git a/components/dashboard/invoices-widget.tsx b/components/dashboard/invoices-widget.tsx index 2c89663..cedfc72 100644 --- a/components/dashboard/invoices-widget.tsx +++ b/components/dashboard/invoices-widget.tsx @@ -5,6 +5,7 @@ import { RiCheckboxCircleLine, RiExternalLinkLine, RiLoader4Line, + RiMoneyDollarCircleLine, } from "@remixicon/react"; import Image from "next/image"; import Link from "next/link"; @@ -87,12 +88,14 @@ const parseDueDate = (period: string, dueDay: string) => { ) { return { label: `Vence dia ${dueDay}`, + date: null, }; } const date = new Date(Date.UTC(year, month - 1, dayNumber)); return { label: `Vence em ${DUE_DATE_FORMATTER.format(date)}`, + date, }; }; @@ -251,6 +254,8 @@ export function InvoicesWidget({ invoices }: InvoicesWidgetProps) { const dueInfo = parseDueDate(invoice.period, invoice.dueDay); const isPaid = invoice.paymentStatus === INVOICE_PAYMENT_STATUS.PAID; + const isOverdue = + !isPaid && dueInfo.date !== null && dueInfo.date < new Date(); const paymentInfo = formatPaymentDate(invoice.paidAt); return ( @@ -381,6 +386,15 @@ export function InvoicesWidget({ invoices }: InvoicesWidgetProps) {Cartão
-- {selectedInvoice.cardName} -
- {selectedInvoice.paymentStatus !== - INVOICE_PAYMENT_STATUS.PAID ? ( -- { - parseDueDate( - selectedInvoice.period, - selectedInvoice.dueDay, - ).label - } -
- ) : null} - {selectedInvoice.paymentStatus === - INVOICE_PAYMENT_STATUS.PAID && selectedPaymentInfo ? ( -- {selectedPaymentInfo.label} -
- ) : null} ++ Cartão +
++ {selectedInvoice.cardName} +
++ { + parseDueDate( + selectedInvoice.period, + selectedInvoice.dueDay, + ).label + } +
+ ) : null} + {selectedInvoice.paymentStatus === + INVOICE_PAYMENT_STATUS.PAID && selectedPaymentInfo ? ( ++ {selectedPaymentInfo.label} +
+ ) : null} +
{preLancamentosCount === 1
? "1 pré-lançamento aguardando revisão"
@@ -206,9 +212,9 @@ export function NotificationBell({
className="flex items-start gap-2 px-2 py-2"
>
{n.status === "exceeded" ? (
-
{n.status === "exceeded" ? ( @@ -243,43 +249,54 @@ export function NotificationBell({ title="Cartão de Crédito" />
- {n.status === "overdue" ? ( - <> - A fatura de {n.name} venceu em{" "} - {formatDate(n.dueDate)} - {n.showAmount && n.amount > 0 && ( - <> - {" "} - — {formatCurrency(n.amount)} - > - )} - > + {invoiceNotifications.map((n) => { + const logo = resolveLogoPath(n.cardLogo); + return ( +
+ {n.status === "overdue" ? ( + <> + A fatura de {n.name} venceu em{" "} + {formatDate(n.dueDate)} + {n.showAmount && n.amount > 0 && ( + <> + {" "} + — {formatCurrency(n.amount)} + > + )} + > + ) : ( + <> + A fatura de {n.name} vence em{" "} + {formatDate(n.dueDate)} + {n.showAmount && n.amount > 0 && ( + <> + {" "} + — {formatCurrency(n.amount)} + > + )} + > + )} +
+{n.status === "overdue" ? ( <> diff --git a/components/pagadores/details/pagador-info-card.tsx b/components/pagadores/details/pagador-info-card.tsx index ba0d537..602f694 100644 --- a/components/pagadores/details/pagador-info-card.tsx +++ b/components/pagadores/details/pagador-info-card.tsx @@ -292,7 +292,7 @@ export function PagadorInfoCard({