summaryrefslogtreecommitdiffhomepage
path: root/packages/console/app/src
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-08 23:44:11 -0500
committerFrank <[email protected]>2026-01-09 01:32:00 -0500
commitdd5ec26c8c09b6374e379ad523e9953ce75a4417 (patch)
tree1532ca1a4c02b894bb4a23bbedffaa7cf5bd8038 /packages/console/app/src
parent8b062ed6214ea83452a453428675a29d84105a79 (diff)
downloadopencode-dd5ec26c8c09b6374e379ad523e9953ce75a4417.tar.gz
opencode-dd5ec26c8c09b6374e379ad523e9953ce75a4417.zip
wip: black
Diffstat (limited to 'packages/console/app/src')
-rw-r--r--packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx18
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx
index e51ccc9f5..d21c4edce 100644
--- a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx
+++ b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx
@@ -1,6 +1,6 @@
import { Billing } from "@opencode-ai/console-core/billing.js"
import { query, action, useParams, createAsync, useAction } from "@solidjs/router"
-import { For, Show } from "solid-js"
+import { For, Match, Show, Switch } from "solid-js"
import { withActor } from "~/context/auth.withActor"
import { formatDateUTC, formatDateForTable } from "../../common"
import styles from "./payment-section.module.css"
@@ -77,7 +77,8 @@ export function PaymentSection() {
<For each={payments()!}>
{(payment) => {
const date = new Date(payment.timeCreated)
- const isCredit = !payment.paymentID
+ const amount =
+ payment.enrichment?.type === "subscription" && payment.enrichment.couponID ? 0 : payment.amount
return (
<tr>
<td data-slot="payment-date" title={formatDateUTC(date)}>
@@ -85,13 +86,14 @@ export function PaymentSection() {
</td>
<td data-slot="payment-id">{payment.id}</td>
<td data-slot="payment-amount" data-refunded={!!payment.timeRefunded}>
- ${((payment.amount ?? 0) / 100000000).toFixed(2)}
- {isCredit ? " (credit)" : ""}
+ ${((amount ?? 0) / 100000000).toFixed(2)}
+ <Switch>
+ <Match when={payment.enrichment?.type === "credit"}> (credit)</Match>
+ <Match when={payment.enrichment?.type === "subscription"}> (subscription)</Match>
+ </Switch>
</td>
<td data-slot="payment-receipt">
- {isCredit ? (
- <span>-</span>
- ) : (
+ {payment.paymentID ? (
<button
onClick={async () => {
const receiptUrl = await downloadReceiptAction(params.id!, payment.paymentID!)
@@ -103,6 +105,8 @@ export function PaymentSection() {
>
View
</button>
+ ) : (
+ <span>-</span>
)}
</td>
</tr>