Skip to content

Commit adc82f7

Browse files
authored
Merge pull request #278 from Lakes41/lakes3
feat: add API integration layer with Next.js route handlers
2 parents 6e74f64 + 08986e9 commit adc82f7

2 files changed

Lines changed: 62 additions & 50 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ tsconfig.tsbuildinfo
2222
# Agent
2323
AEGNTS.md
2424

25+
# Agent
26+
AEGNTS.md
27+
2528
# IDE
2629
.vscode
2730
.idea

src/app/page.tsx

Lines changed: 59 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -236,56 +236,65 @@ export default function Page() {
236236
</div>
237237
</div>
238238

239-
{/* Invoice Table */}
240-
<div className="bg-tradeflow-secondary rounded-2xl border border-tradeflow-muted overflow-hidden mb-12">
241-
<div className="p-6 border-b border-slate-700">
242-
<h2 className="text-xl font-semibold">Verified Asset Pipeline</h2>
243-
</div>
244-
<table className="w-full text-left">
245-
<thead className="bg-tradeflow-dark/50 text-tradeflow-muted text-sm uppercase">
246-
<tr>
247-
<th className="p-4">Invoice ID</th>
248-
<th className="p-4">Risk Score</th>
249-
<th className="p-4">Status</th>
250-
<th className="p-4">Amount</th>
251-
</tr>
252-
</thead>
253-
<tbody>
254-
{loading ? (
255-
// Show 5 skeleton rows while loading
256-
Array.from({ length: 5 }).map((_, index) => (
257-
<SkeletonRow key={`skeleton-${index}`} />
258-
))
259-
) : (
260-
invoices.map((inv: { id: string; riskScore: number; status: string; amount: number | string }) => (
261-
<tr
262-
key={inv.id}
263-
className="border-b border-tradeflow-muted/50 hover:bg-tradeflow-muted/20 transition"
264-
>
265-
<td className="p-4 font-mono text-sm text-blue-300">
266-
#{inv.id.slice(-6)}
267-
</td>
268-
<td className="p-4">
269-
<div className="w-full bg-tradeflow-muted h-2 rounded-full max-w-[100px]">
270-
<div
271-
className="bg-blue-500 h-2 rounded-full"
272-
style={{ width: `${inv.riskScore}%` }}
273-
></div>
274-
</div>
275-
</td>
276-
<td className="p-4 text-sm font-medium">
277-
<span
278-
className={`px-3 py-1 rounded-full ${inv.status === "Approved" ? "bg-tradeflow-success/20 text-tradeflow-success" : "bg-tradeflow-warning/20 text-tradeflow-warning"}`}
279-
>
280-
{inv.status}
281-
</span>
282-
</td>
283-
<td className="p-4 font-bold text-lg">${inv.amount}</td>
284-
</tr>
285-
))
286-
)}
287-
</tbody>
288-
</table>
239+
{/* Invoice Table */}
240+
<div className="bg-tradeflow-secondary rounded-2xl border border-tradeflow-muted overflow-hidden mb-12">
241+
<div className="p-6 border-b border-slate-700">
242+
<h2 className="text-xl font-semibold">Verified Asset Pipeline</h2>
243+
</div>
244+
<table className="w-full text-left">
245+
<thead className="bg-tradeflow-dark/50 text-tradeflow-muted text-sm uppercase">
246+
<tr>
247+
<th className="p-4">Invoice ID</th>
248+
<th className="p-4">Risk Score</th>
249+
<th className="p-4">Status</th>
250+
<th className="p-4">Amount</th>
251+
</tr>
252+
</thead>
253+
<tbody>
254+
{loading ? (
255+
// Show 5 skeleton rows while loading
256+
Array.from({ length: 5 }).map((_, index) => (
257+
<SkeletonRow key={`skeleton-${index}`} />
258+
))
259+
) : (
260+
invoices.map((inv) => (
261+
<tr
262+
key={inv.id}
263+
className="border-b border-tradeflow-muted/50 hover:bg-tradeflow-muted/20 transition"
264+
>
265+
<td className="p-4 font-mono text-sm text-blue-300">
266+
#{inv.id.slice(-6)}
267+
</td>
268+
<td className="p-4">
269+
<div className="w-full bg-tradeflow-muted h-2 rounded-full max-w-[100px]">
270+
<div
271+
className="bg-blue-500 h-2 rounded-full"
272+
style={{ width: `${inv.riskScore}%` }}
273+
></div>
274+
</div>
275+
</td>
276+
<td className="p-4 text-sm font-medium">
277+
<span
278+
className={`px-3 py-1 rounded-full ${inv.status === "Approved" ? "bg-tradeflow-success/20 text-tradeflow-success" : "bg-tradeflow-warning/20 text-tradeflow-warning"}`}
279+
>
280+
{inv.status}
281+
</span>
282+
</td>
283+
<td className="p-4 font-bold text-lg">${inv.amount}</td>
284+
</tr>
285+
))
286+
)}
287+
</tbody>
288+
</table>
289+
</div>
290+
291+
{/* Active Loans Table (Issue #6) */}
292+
<div className="bg-tradeflow-secondary rounded-2xl border border-tradeflow-muted overflow-hidden">
293+
<div className="p-6 border-b border-slate-700">
294+
<h2 className="text-xl font-semibold">Active Loans Dashboard</h2>
295+
</div>
296+
<div className="p-6 bg-tradeflow-dark/50">
297+
<LoanTable />
289298
</div>
290299

291300
{/* Active Loans Table (Issue #6) */}

0 commit comments

Comments
 (0)