mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44:21 +01:00
ignore: zen
This commit is contained in:
@@ -174,12 +174,19 @@ export function BillingSection() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-slot="usage">
|
<div data-slot="usage">
|
||||||
<Show when={!balanceInfo()?.reload && !(balanceAmount() === "0.00" || balanceAmount() === "-0.00")}>
|
<Show when={!balanceInfo()?.reload}>
|
||||||
|
<Show
|
||||||
|
when={!(balanceAmount() === "0.00" || balanceAmount() === "-0.00")}
|
||||||
|
fallback={
|
||||||
|
<p>We'll load <b>$20</b> (+$1.23 processing fee) and reload it when it reaches <b>$5</b>.</p>
|
||||||
|
}
|
||||||
|
>
|
||||||
<p>
|
<p>
|
||||||
You have <b data-slot="value">${balanceAmount() === "-0.00" ? "0.00" : balanceAmount()}</b> remaining in
|
You have <b data-slot="value">${balanceAmount() === "-0.00" ? "0.00" : balanceAmount()}</b> remaining in
|
||||||
your account. You can continue using the API with your remaining balance.
|
your account. You can continue using the API with your remaining balance.
|
||||||
</p>
|
</p>
|
||||||
</Show>
|
</Show>
|
||||||
|
</Show>
|
||||||
<Show when={balanceInfo()?.reload && !balanceInfo()?.reloadError}>
|
<Show when={balanceInfo()?.reload && !balanceInfo()?.reloadError}>
|
||||||
<p>
|
<p>
|
||||||
Your current balance is <b data-slot="value">${balanceAmount() === "-0.00" ? "0.00" : balanceAmount()}</b>
|
Your current balance is <b data-slot="value">${balanceAmount() === "-0.00" ? "0.00" : balanceAmount()}</b>
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ export function PaymentSection() {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
data-slot="receipt-button"
|
data-slot="receipt-button"
|
||||||
style="cursor: pointer;"
|
|
||||||
>
|
>
|
||||||
view
|
view
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import "./[id].css"
|
import "./[id].css"
|
||||||
import { Billing } from "@opencode/console-core/billing.js"
|
|
||||||
import { query, useParams, createAsync } from "@solidjs/router"
|
|
||||||
import { Show } from "solid-js"
|
|
||||||
import { withActor } from "~/context/auth.withActor"
|
|
||||||
import { MonthlyLimitSection } from "~/component/workspace/monthly-limit-section"
|
import { MonthlyLimitSection } from "~/component/workspace/monthly-limit-section"
|
||||||
import { NewUserSection } from "~/component/workspace/new-user-section"
|
import { NewUserSection } from "~/component/workspace/new-user-section"
|
||||||
import { BillingSection } from "~/component/workspace/billing-section"
|
import { BillingSection } from "~/component/workspace/billing-section"
|
||||||
@@ -10,17 +6,7 @@ import { PaymentSection } from "~/component/workspace/payment-section"
|
|||||||
import { UsageSection } from "~/component/workspace/usage-section"
|
import { UsageSection } from "~/component/workspace/usage-section"
|
||||||
import { KeySection } from "~/component/workspace/key-section"
|
import { KeySection } from "~/component/workspace/key-section"
|
||||||
|
|
||||||
const getBillingInfo = query(async (workspaceID: string) => {
|
|
||||||
"use server"
|
|
||||||
return withActor(async () => {
|
|
||||||
return await Billing.get()
|
|
||||||
}, workspaceID)
|
|
||||||
}, "billing.get")
|
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const params = useParams()
|
|
||||||
const balanceInfo = createAsync(() => getBillingInfo(params.id))
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div data-page="workspace-[id]">
|
<div data-page="workspace-[id]">
|
||||||
<section data-component="title-section">
|
<section data-component="title-section">
|
||||||
@@ -38,10 +24,7 @@ export default function () {
|
|||||||
<NewUserSection />
|
<NewUserSection />
|
||||||
<KeySection />
|
<KeySection />
|
||||||
<BillingSection />
|
<BillingSection />
|
||||||
<Show when={true}>
|
|
||||||
{/*<Show when={balanceInfo()?.reload}>*/}
|
|
||||||
<MonthlyLimitSection />
|
<MonthlyLimitSection />
|
||||||
</Show>
|
|
||||||
<UsageSection />
|
<UsageSection />
|
||||||
<PaymentSection />
|
<PaymentSection />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user