feat: implement loading state and error handling in PricingSection; add Suspense for async components in Pricing and Settings pages

This commit is contained in:
Usman Baig
2026-01-31 17:29:54 +01:00
parent 8550909047
commit f085c11ba3
5 changed files with 69 additions and 11 deletions

View File

@@ -45,3 +45,16 @@ export async function createPortalSession(): Promise<{ url: string }> {
method: 'POST',
})
}
export interface CreateCheckoutParams {
plan_id: string
interval: string
limit: number
}
export async function createCheckoutSession(params: CreateCheckoutParams): Promise<{ url: string }> {
return await billingFetch<{ url: string }>('/api/billing/checkout', {
method: 'POST',
body: JSON.stringify(params),
})
}