Skip to content

Commit 322e2b9

Browse files
chore: generate
1 parent afd6f3b commit 322e2b9

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

‎packages/console/app/src/lib/lite-usage.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ export type LiteUsageBreakdownItem = {
1717
estimated: boolean
1818
}
1919

20-
export function buildLiteUsageBreakdown(input: {
21-
usage: number
22-
limit: number
23-
sources: LiteUsageBreakdownSource[]
24-
}) {
20+
export function buildLiteUsageBreakdown(input: { usage: number; limit: number; sources: LiteUsageBreakdownSource[] }) {
2521
const rows: LiteUsageBreakdownItem[] = input.sources
2622
.filter((item) => item.cost !== 0 || item.quotaCost !== 0)
2723
.sort((a, b) => b.quotaCost - a.quotaCost)

‎packages/console/app/src/routes/workspace/[id]/go/lite-section.tsx‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export const queryLiteUsageDetails = query(async (workspaceID: string, window: L
140140
const now = new Date()
141141
const detail = (() => {
142142
if (window === "rolling") {
143-
const active = !!row.timeRollingUpdated && row.timeRollingUpdated >= new Date(now.getTime() - limits.rollingWindow * 3600 * 1000)
143+
const active =
144+
!!row.timeRollingUpdated &&
145+
row.timeRollingUpdated >= new Date(now.getTime() - limits.rollingWindow * 3600 * 1000)
144146
return {
145147
start: active ? row.timeRollingUpdated! : now,
146148
usage: active ? (row.rollingUsage ?? 0) : 0,
@@ -356,7 +358,12 @@ function LiteUsageItem(props: {
356358
)
357359
}
358360

359-
function LiteUsageDetails(props: { id: LiteUsageWindow; label: string; quotaLabel: string; usage: LiteUsageDetailsData }) {
361+
function LiteUsageDetails(props: {
362+
id: LiteUsageWindow
363+
label: string
364+
quotaLabel: string
365+
usage: LiteUsageDetailsData
366+
}) {
360367
const i18n = useI18n()
361368
const language = useLanguage()
362369
const money = (amount: number) =>
@@ -480,12 +487,7 @@ function LiteUsageGroup(props: { lite: NonNullable<LiteSubscription> }) {
480487
}
481488
>
482489
{(usage) => (
483-
<LiteUsageDetails
484-
id={item().id}
485-
label={item().label}
486-
quotaLabel={item().quotaLabel}
487-
usage={usage()}
488-
/>
490+
<LiteUsageDetails id={item().id} label={item().label} quotaLabel={item().quotaLabel} usage={usage()} />
489491
)}
490492
</Show>
491493
)

0 commit comments

Comments
 (0)