Files
mpc/dashboard/components/payments/payment-request-table.tsx
zeekayandHanzo Dev 8b6850e316 fix(dashboard): monochrome — the landing page was the fleet's loudest exception
Measured on the rendered pixels, not the source: the MPC dashboard's home page
carried 1.05% of every frame in hue at mean chroma 1.279, against explore's
0.004 next door. It came from four places, all literals no hostname could
retheme:

  app/page.tsx      violet→blue gradient wordmark (from-violet-500 to-blue-500)
                    feature headings text-violet-400 / text-blue-400 /
                    text-emerald-400, and ten chain chips on border-violet-500/20
                    bg-violet-500/10 text-violet-300 — the #ece7f7 wash that was
                    10,776 pixels of one screenshot
  app/docs/page.tsx the same violet, plus border-violet/blue/emerald/purple-500/30

and 15 more files reaching for Tailwind's chromatic ramps directly. Those now
resolve through the tokens @luxfi/ui owns: green/emerald → --color-status-good,
red/rose → --color-status-bad, yellow/amber → --color-status-warn (achromatic —
attention is the loudest neutral in Lux, not a hue), everything else onto
foreground / muted / border.

After: warm 0%, tinted-neutral 0%, mean chroma 0.000 at 1440x900 and 390x844,
in light and dark. Distinction is carried by the LABEL, which already read
CGGMP21 / FROST / Bridge.

@luxfi/ui 7.4.5 -> 7.4.9.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 19:01:45 -07:00

75 lines
2.7 KiB
TypeScript

import Link from 'next/link'
export interface PaymentRequest {
id: string
merchantName: string
recipientAddress: string
chain: string
amount: string
status: 'open' | 'paid' | 'expired' | 'cancelled'
expiresAt: string
createdAt: string
}
export interface PaymentRequestTableProps {
requests: PaymentRequest[]
}
const statusColors: Record<string, string> = {
open: 'bg-muted text-foreground',
paid: 'bg-green-600/20 text-green-500',
expired: 'bg-zinc-600/20 text-zinc-400',
cancelled: 'bg-red-600/20 text-red-400',
}
export function PaymentRequestTable({ requests }: PaymentRequestTableProps) {
if (requests.length === 0) {
return (
<div className="rounded-lg border border-border p-8 text-center text-sm text-muted-foreground">
No payment requests found.
</div>
)
}
return (
<div className="overflow-x-auto rounded-lg border border-border">
<table className="w-full text-sm">
<thead>
<tr className="border-b border-border bg-muted/50">
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Merchant</th>
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Recipient</th>
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Chain</th>
<th className="px-4 py-3 text-right font-medium text-muted-foreground">Amount</th>
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Status</th>
<th className="px-4 py-3 text-right font-medium text-muted-foreground">Expires</th>
</tr>
</thead>
<tbody>
{requests.map((req) => (
<tr key={req.id} className="border-b border-border last:border-0 hover:bg-muted/20">
<td className="px-4 py-3">
<Link href={`/payments/${req.id}`} className="font-medium hover:underline">
{req.merchantName || 'Unnamed'}
</Link>
</td>
<td className="px-4 py-3 font-mono text-xs">
<span className="truncate block max-w-[140px]">{req.recipientAddress}</span>
</td>
<td className="px-4 py-3">{req.chain}</td>
<td className="px-4 py-3 text-right font-mono">{req.amount}</td>
<td className="px-4 py-3">
<span className={`rounded-full px-2 py-0.5 text-xs font-medium ${statusColors[req.status] ?? ''}`}>
{req.status}
</span>
</td>
<td className="px-4 py-3 text-right text-muted-foreground">
{new Date(req.expiresAt).toLocaleString()}
</td>
</tr>
))}
</tbody>
</table>
</div>
)
}