'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Check, Loader2 } from 'lucide-react' import { PLANS, type PlanKey } from '@/lib/stripe/config' export default function PricingPage() { const router = useRouter() const [loading, setLoading] = useState(null) const handleSubscribe = async (plan: PlanKey) => { if (plan === 'free') { router.push('/auth/signup') return } setLoading(plan) try { const res = await fetch('/api/stripe/checkout', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ plan }), }) const data = await res.json() if (data.error === 'Unauthorized') { router.push('/auth/login?redirect=/pricing') return } if (data.url) { window.location.href = data.url } } catch (error) { console.error('Checkout error:', error) } finally { setLoading(null) } } return (

Simple, transparent pricing

Start free, upgrade when you need more. No hidden fees.

{(Object.entries(PLANS) as [PlanKey, typeof PLANS[PlanKey]][]).map(([key, plan]) => ( {key === 'pro' && ( Most Popular )} {plan.name} ${plan.price} {plan.price > 0 && ( /month )}
    {plan.features.map((feature) => (
  • {feature}
  • ))}
))}

All plans include SSL encryption and 99.9% uptime SLA.

Questions? Contact support@mylder.io

) }