From 4b1eca73eb64c62ebdf668eb18d587510066bd9d Mon Sep 17 00:00:00 2001 From: Jay V Date: Tue, 16 Sep 2025 16:16:30 -0400 Subject: ignore: zen --- .../src/component/workspace/payment-section.tsx | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 cloud/app/src/component/workspace/payment-section.tsx (limited to 'cloud/app/src/component/workspace/payment-section.tsx') diff --git a/cloud/app/src/component/workspace/payment-section.tsx b/cloud/app/src/component/workspace/payment-section.tsx new file mode 100644 index 000000000..f802fa96a --- /dev/null +++ b/cloud/app/src/component/workspace/payment-section.tsx @@ -0,0 +1,56 @@ +import { Billing } from "@opencode/cloud-core/billing.js" +import { query, useParams, createAsync } from "@solidjs/router" +import { For } from "solid-js" +import { withActor } from "~/context/auth.withActor" +import { formatDateUTC, formatDateForTable } from "./common" + +const getPaymentsInfo = query(async (workspaceID: string) => { + "use server" + return withActor(async () => { + return await Billing.payments() + }, workspaceID) +}, "payment.list") + +export function PaymentSection() { + const params = useParams() + const payments = createAsync(() => getPaymentsInfo(params.id)) + + return ( + payments() && + payments()!.length > 0 && ( +
+
+

Payments History

+

Recent payment transactions.

+
+
+ + + + + + + + + + + {(payment) => { + const date = new Date(payment.timeCreated) + return ( + + + + + + ) + }} + + +
DatePayment IDAmount
+ {formatDateForTable(date)} + {payment.id}${((payment.amount ?? 0) / 100000000).toFixed(2)}
+
+
+ ) + ) +} -- cgit v1.2.3