Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
03e0b1f912
commit
4d5b4027db
@@ -316,6 +316,40 @@ function Dashboard() {
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Recent payments */}
|
||||
<div className="grid lg:grid-cols-2 gap-6 mt-6">
|
||||
<Card>
|
||||
<CardHeader className="flex flex-row items-center justify-between">
|
||||
<CardTitle className="text-base flex items-center gap-2">
|
||||
<CreditCard className="h-4 w-4" />
|
||||
Recent payments
|
||||
</CardTitle>
|
||||
<Button asChild variant="ghost" size="sm">
|
||||
<Link to="/payments">View all <ArrowRight className="h-3 w-3 ml-1" /></Link>
|
||||
</Button>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-1">
|
||||
{recentPayments.length === 0 && <p className="text-sm text-muted-foreground">No payment requests yet.</p>}
|
||||
{recentPayments.map((p) => (
|
||||
<Link key={p.id} to="/pay/$id" params={{ id: p.id }}
|
||||
className="flex items-center justify-between py-2.5 px-2 rounded-md hover:bg-muted/60 -mx-2">
|
||||
<div className="min-w-0">
|
||||
<div className="text-sm font-medium truncate">{p.recipient_name}</div>
|
||||
<div className="text-xs text-muted-foreground truncate">
|
||||
{p.description || "Payment request"} · {formatDate(p.paid_at || p.created_at)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-sm font-medium">{formatCurrency((p.total_amount_cents ?? 0) / 100)}</span>
|
||||
<Badge variant="outline" className={statusBadgeClass(p.status)}>{p.status}</Badge>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user