+
+
+ ) : isLoading ? (
+
+
+
+
+ ) : (
+ <>
+
-
-
+
+
+
-
-
-
+
+
+
+ >
+ )}
= {
overdue: "Overdue",
urgent: "Due Soon",
@@ -79,7 +79,7 @@ function StatusBadge({ status }: { status: Bill["status"] }) {
return (
@@ -88,7 +88,7 @@ function StatusBadge({ status }: { status: Bill["status"] }) {
);
}
-// ─── Recurring chain badge ────────────────────────────────────────────────────
+// ─── Exported Component ─────────────────────────────────────────────────────────
function RecurringBadge({
recurrenceLabel,
diff --git a/components/Bills/RecentPaymentsSection.tsx b/components/Bills/RecentPaymentsSection.tsx
index 1135cc8..f84e3f3 100644
--- a/components/Bills/RecentPaymentsSection.tsx
+++ b/components/Bills/RecentPaymentsSection.tsx
@@ -1,11 +1,13 @@
"use client";
import { BillCards } from "@/components/Bills/BillsCard";
-import { mockPaidBills } from "@/lib/mockdata/bills";
import { useDensity } from "@/lib/context/DensityContext";
+import { Bill } from '@/lib/contracts/bill-payments';
+import { WidgetEmptyState } from '@/components/ui/WidgetStates';
-export default function RecentPaymentsSection() {
+export default function RecentPaymentsSection({ bills }: { bills: Bill[] }) {
const { density } = useDensity();
+ const paidBills = bills.filter((bill) => bill.status === 'paid');
return (
-
- {mockPaidBills.map((bill) => (
-
- ))}
-
+ {paidBills.length > 0 ? (
+
+ {paidBills.map((bill) => (
+
+ ))}
+
+ ) : (
+
+
+
+ );
+}
+
+export function WidgetErrorState({ title, message, onRetry }: { title: string; message?: string; onRetry?: () => void }) {
+ return (
+ {title}
+ {message &&{message}
} +
+
+
+ );
+}
{title}
+ {message &&{message}
} + {onRetry && ( + + )} +