diff --git a/src/components/autumn/custom-pricing-table.tsx b/src/components/autumn/custom-pricing-table.tsx index 7e77a82d..27e6d4bf 100644 --- a/src/components/autumn/custom-pricing-table.tsx +++ b/src/components/autumn/custom-pricing-table.tsx @@ -7,7 +7,6 @@ import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Switch } from "@/components/ui/switch"; import { Badge } from "@/components/ui/badge"; -import CheckoutDialog from "@/components/autumn/checkout-dialog"; import { getPricingTableContent } from "@/lib/autumn/pricing-table-content"; import { Check, Loader2, Sparkles, Zap } from "lucide-react"; @@ -112,11 +111,12 @@ export default function CustomPricingTable({ productDetails, className }: Custom {/* Pricing Cards Grid */}
3 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-4" + filteredProducts.length === 0 && "grid-cols-1 max-w-md", + filteredProducts.length === 1 && "grid-cols-1 md:grid-cols-2", + filteredProducts.length === 2 && "grid-cols-1 md:grid-cols-3", + filteredProducts.length >= 3 && "grid-cols-1 md:grid-cols-2 lg:grid-cols-4" )}> + {filteredProducts.map((product, index) => ( +
+ {/* Plan Name & Description */} +
+

Free

+

+ Perfect for trying out ZapDev +

+
+ + {/* Price */} +
+
+ $0 + /month +
+
+ + {/* Features List */} +
+
    +
  • +
    +
    + +
    +
    +
    +

    5 generations daily

    +

    Resets every 24 hours

    +
    +
  • +
  • +
    +
    + +
    +
    +
    +

    All frameworks

    +

    Next.js, React, Vue, Angular, Svelte

    +
    +
  • +
  • +
    +
    + +
    +
    +
    +

    Real-time preview

    +

    Live sandbox environment

    +
    +
  • +
+
+
+ + {/* CTA Button */} +
+ +

+ Your current plan +

+
+
+ ); +} + interface PricingCardProps { product: Product; customer: any; @@ -148,10 +228,20 @@ function PricingCard({ product, customer, checkout, isRecommended }: PricingCard setLoading(true); try { if (product.id && customer) { - await checkout({ + // Get checkout data and redirect to Stripe + const { data, error } = await checkout({ productId: product.id, - dialog: CheckoutDialog, }); + + if (error) { + console.error("Checkout error:", error); + return; + } + + // Redirect to Stripe checkout URL if available + if (data?.url) { + window.location.href = data.url; + } } else if (product.display?.button_url) { window.open(product.display?.button_url, "_blank", "noopener,noreferrer"); }