From 058163333d7867b47626a11464f26b3e3556f29d Mon Sep 17 00:00:00 2001 From: Jay V Date: Fri, 29 Aug 2025 17:57:59 -0400 Subject: [PATCH] ignore: cloud payment history --- cloud/app/src/routes/workspace/[id].tsx | 76 ++++++++++++++++----- cloud/app/src/routes/workspace/index.css | 84 +++++++++++++++++------- 2 files changed, 122 insertions(+), 38 deletions(-) diff --git a/cloud/app/src/routes/workspace/[id].tsx b/cloud/app/src/routes/workspace/[id].tsx index 6000228d..8e6a0ee6 100644 --- a/cloud/app/src/routes/workspace/[id].tsx +++ b/cloud/app/src/routes/workspace/[id].tsx @@ -102,7 +102,35 @@ const dummyUsageData = [ }, ] -export default function() { +const dummyPaymentData = [ + { + id: "pay_1Ab2Cd3Ef4Gh5678", + amount: 2000000000, + timeCreated: new Date("2025-01-28T14:32:00Z"), + }, + { + id: "pay_9Ij8Kl7Mn6Op5432", + amount: 1000000000, + timeCreated: new Date("2025-01-25T09:18:00Z"), + }, + { + id: "pay_5Qr4St3Uv2Wx1098", + amount: 5000000000, + timeCreated: new Date("2025-01-20T16:45:00Z"), + }, + { + id: "pay_7Yz6Ab5Cd4Ef3210", + amount: 1500000000, + timeCreated: new Date("2025-01-15T11:22:00Z"), + }, + { + id: "pay_3Gh2Ij1Kl0Mn9876", + amount: 3000000000, + timeCreated: new Date("2025-01-10T13:55:00Z"), + }, +] + +export default function () { const actor = createAsync(() => getActor()) onMount(() => { console.log("MOUNTED", actor()) @@ -354,24 +382,40 @@ export default function() { {/* Payments Section */} - 0}> + 0}> + {/* Real data condition: billingInfo() && billingInfo()!.payments.length > 0 */}

Payments History

-

Your recent payment transactions.

+

Recent payment transactions.

-
- - {(payment) => ( -
- {payment.id} - {" | "} - ${((payment.amount ?? 0) / 100000000).toFixed(2)} - {" | "} - {new Date(payment.timeCreated).toLocaleDateString()} -
- )} -
+
+ + + + + + + + + + + {/* Real data: billingInfo()?.payments */} + {(payment) => { + const date = new Date(payment.timeCreated) + return ( + + + + + + ) + }} + + +
DatePayment IDAmount
+ {formatDateForTable(date)} + {payment.id}${((payment.amount ?? 0) / 100000000).toFixed(2)}
@@ -380,7 +424,7 @@ export default function() {

Usage History

-

Your recent API usage and costs.

+

Recent API usage and costs.