- {Array.from({ length: 6 }).map((_, i) => (
-
- ))}
+
+ {link.amount
+ ? formatCurrency(link.amount, link.currency)
+ : "Open amount"}
- ) : hasLinks ? (
-
- {links.map((link) => (
-
- ))}
+
+
+ {link.description}
+
+
+ {/* ACTIONS */}
+
+
+
+
- ) : showNoResults ? (
-
{
- setSearch("");
- setStatusFilter("all");
- }}
- >
- Clear Filters
-
- }
- />
- ) : showNoLinks ? (
- setIsCreateModalOpen(true),
- }}
- />
- ) : null}
-
- {/* Create Link Modal */}
-
-
- {/* Link Created Modal */}
- {createdLink && (
- {
- if (!open) setCreatedLink(null);
- }}
- linkUrl={createdLink.url}
- linkName={createdLink.description || "Payment Link"}
- />
- )}
-
- {/* QR Code Modal */}
- {selectedLinkForQR && (
-
+
+ {/* STATS */}
+
+
+
+
- )}
-
- {/* Deactivate Confirmation Dialog */}
-
+
+ {/* PAYMENTS */}
+
+
Recent Payments
+
+ {payments.length === 0 ? (
+
+ No payments yet
+
+ ) : (
+
+ {payments.slice(0, 10).map((p: any) => (
+
+ {p.payer ?? "—"}
+
+ {formatCurrency(p.amount, p.currency)}
+
+ {p.status}
+
+ ))}
+
+ )}
+
+
+ View all payments →
+
+
-
-
-
-
-
-
+ {/* SIDEBAR */}
+
+
+ Created:{" "}
+ {new Date(link.createdAt).toLocaleString()}
+
+
+
+ Updated:{" "}
+ {new Date(link.updatedAt).toLocaleString()}
+
+
+
+ Type: {link.type}
+
+
+
+ Expiry:{" "}
+ {link.expiresAt
+ ? new Date(link.expiresAt).toLocaleDateString()
+ : "Never"}
+
+
+ {link.status === "active" && (
+
+ )}
+
);
}
+
+/* ---------- helper ---------- */
+function Stat({
+ label,
+ value,
+}: {
+ label: string;
+ value: string | number;
+}) {
+ return (
+
+
+ {label}
+
+
{value}
+
+ );
+}
\ No newline at end of file