From 9ef5c7d79648b2845568f71e95d9a98ce36eefd6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 05:09:42 +0000 Subject: [PATCH] Redirect to Stripe checkout and add free plan card - Remove checkout dialog in favor of direct Stripe redirect - Add free plan card showing 5 generations daily - Update grid layout to accommodate free plan alongside paid tiers --- .../autumn/custom-pricing-table.tsx | 104 ++++++++++++++++-- 1 file changed, 97 insertions(+), 7 deletions(-) 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"); }