Skip to content

Commit a5a70fa

Browse files
committed
wip: zen lite
1 parent 5596775 commit a5a70fa

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Billing } from "@opencode-ai/console-core/billing.js"
55
import { Database, eq, and, isNull, sql } from "@opencode-ai/console-core/drizzle/index.js"
66
import { BillingTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js"
77
import { Actor } from "@opencode-ai/console-core/actor.js"
8-
import { Subscription } from "@opencode-ai/console-core/black.js"
8+
import { Subscription } from "@opencode-ai/console-core/subscription.js"
9+
import { BlackData } from "@opencode-ai/console-core/black.js"
910
import { withActor } from "~/context/auth.withActor"
1011
import { queryBillingInfo } from "../../common"
1112
import styles from "./black-section.module.css"
@@ -31,17 +32,19 @@ const querySubscription = query(async (workspaceID: string) => {
3132
.then((r) => r[0]),
3233
)
3334
if (!row?.subscription) return null
35+
const blackData = BlackData.getLimits({ plan: row.subscription.plan })
3436

3537
return {
3638
plan: row.subscription.plan,
3739
useBalance: row.subscription.useBalance ?? false,
3840
rollingUsage: Subscription.analyzeRollingUsage({
39-
plan: row.subscription.plan,
41+
limit: blackData.rollingLimit,
42+
window: blackData.rollingWindow,
4043
usage: row.rollingUsage ?? 0,
4144
timeUpdated: row.timeRollingUpdated ?? new Date(),
4245
}),
4346
weeklyUsage: Subscription.analyzeWeeklyUsage({
44-
plan: row.subscription.plan,
47+
limit: blackData.fixedLimit,
4548
usage: row.fixedUsage ?? 0,
4649
timeUpdated: row.timeFixedUpdated ?? new Date(),
4750
}),

0 commit comments

Comments
 (0)