Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ui/registry/checkout-dialog/checkout-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { getCheckoutContent } from "@/registry/checkout-dialog/lib/checkout-content";
import { useCustomer } from "autumn-js/react";
import { ArrowRight, ChevronDown, Loader2 } from "lucide-react";
import type { CheckoutResult, ProductItem } from "autumn-js";
import { UsageModel, type CheckoutResult, type ProductItem } from 'autumn-js';
import {
Accordion,
AccordionContent,
Expand Down Expand Up @@ -153,7 +153,7 @@ function DueAmounts({ checkoutResult }: { checkoutResult: CheckoutResult }) {
: undefined;

const hasUsagePrice = product.items.some(
(item) => item.usage_model === "pay_per_use"
(item) => item.usage_model === UsageModel.PayPerUse
);

const showNextCycle = next_cycle && next_cycle.total !== checkoutResult.total;
Expand Down Expand Up @@ -209,12 +209,12 @@ function ProductItems({
{checkoutResult?.product.items
.filter((item) => item.type !== "feature")
.map((item, index) => {
if (item.usage_model == "prepaid") {
if (item.usage_model === UsageModel.Prepaid) {
return (
<PrepaidItem
key={index}
item={item}
checkoutResult={checkoutResult!}
checkoutResult={checkoutResult}
setCheckoutResult={setCheckoutResult}
/>
);
Expand Down Expand Up @@ -346,7 +346,7 @@ const PrepaidItem = ({
console.error(error);
return;
}
setCheckoutResult(data!);
setCheckoutResult(data);
} catch (error) {
console.error(error);
} finally {
Expand Down