'use client' import { useEffect, useState } from 'react' import { useRouter } from 'next/navigation' import { Header } from '@/components/Header' import { Footer } from '@/components/Footer' import { useStore } from '@/lib/store' import { api } from '@/lib/api' import { Check, ArrowRight, Zap, TrendingUp, Crown, Loader2, Clock, X } from 'lucide-react' import Link from 'next/link' import clsx from 'clsx' const tiers = [ { id: 'scout', name: 'Scout', icon: Zap, price: '0', period: '', description: 'Test the waters. Zero risk.', features: [ { text: '5 domains to track', highlight: false, available: true }, { text: 'Daily availability scans', highlight: false, available: true }, { text: 'Email alerts', highlight: false, available: true }, { text: 'Raw auction feed', highlight: false, available: true, sublabel: 'Unfiltered' }, { text: 'Curated auction list', highlight: false, available: false }, { text: 'Deal scores & valuations', highlight: false, available: false }, ], cta: 'Start Free', highlighted: false, badge: null, isPaid: false, }, { id: 'trader', name: 'Trader', icon: TrendingUp, price: '9', period: '/mo', description: 'The smart investor\'s choice.', features: [ { text: '50 domains to track', highlight: true, available: true }, { text: 'Hourly scans', highlight: true, available: true, sublabel: '24x faster' }, { text: 'Smart spam filter', highlight: true, available: true, sublabel: 'Curated list' }, { text: 'Deal scores & valuations', highlight: true, available: true }, { text: 'Portfolio tracking (25)', highlight: true, available: true }, { text: '90-day price history', highlight: false, available: true }, { text: 'Expiry date tracking', highlight: true, available: true }, ], cta: 'Upgrade to Trader', highlighted: true, badge: 'Best Value', isPaid: true, }, { id: 'tycoon', name: 'Tycoon', icon: Crown, price: '29', period: '/mo', description: 'For serious domain investors.', features: [ { text: '500 domains to track', highlight: true, available: true }, { text: 'Real-time scans', highlight: true, available: true, sublabel: 'Every 10 min' }, { text: 'Priority alerts', highlight: true, available: true }, { text: 'Unlimited portfolio', highlight: true, available: true }, { text: 'Full price history', highlight: true, available: true }, { text: 'Advanced valuation', highlight: true, available: true }, { text: 'API access', highlight: true, available: true, sublabel: 'Coming soon' }, ], cta: 'Go Tycoon', highlighted: false, badge: 'Full Power', isPaid: true, }, ] const comparisonFeatures = [ { name: 'Watchlist Domains', scout: '5', trader: '50', tycoon: '500' }, { name: 'Check Frequency', scout: 'Daily', trader: 'Hourly', tycoon: '10 min' }, { name: 'Auction Feed', scout: 'Raw (unfiltered)', trader: 'Curated (spam-free)', tycoon: 'Curated (spam-free)' }, { name: 'Deal Scores', scout: '—', trader: 'check', tycoon: 'check' }, { name: 'Portfolio Domains', scout: '—', trader: '25', tycoon: 'Unlimited' }, { name: 'Domain Valuation', scout: '—', trader: 'check', tycoon: 'Advanced' }, { name: 'Price History', scout: '—', trader: '90 days', tycoon: 'Unlimited' }, { name: 'Expiry Tracking', scout: '—', trader: 'check', tycoon: 'check' }, ] const faqs = [ { q: 'How fast will I know when a domain drops?', a: 'Depends on your plan. Scout: daily. Trader: hourly. Tycoon: every 10 minutes. When it drops, you\'ll know.', }, { q: 'What\'s domain valuation?', a: 'Our algorithm scores domains on length, TLD value, keywords, and brandability. Know what a domain is worth before you buy.', }, { q: 'Can I track domains I already own?', a: 'Absolutely. Trader and Tycoon plans include portfolio tracking. See value changes, renewal dates, and ROI at a glance.', }, { q: 'Can I upgrade or downgrade anytime?', a: 'Absolutely. You can change your plan at any time. Upgrades take effect immediately, and downgrades apply at the next billing cycle.', }, { q: 'Is there a money-back guarantee?', a: 'Yes. We offer a 14-day money-back guarantee on all paid plans—no questions asked.', }, ] export default function PricingPage() { const router = useRouter() const { checkAuth, isLoading, isAuthenticated } = useStore() const [loadingPlan, setLoadingPlan] = useState(null) const [expandedFaq, setExpandedFaq] = useState(null) useEffect(() => { checkAuth() }, [checkAuth]) const handleSelectPlan = async (planId: string, isPaid: boolean) => { if (!isAuthenticated) { router.push(`/register?redirect=/pricing`) return } if (!isPaid) { router.push('/dashboard') return } setLoadingPlan(planId) try { const response = await api.createCheckoutSession( planId, `${window.location.origin}/dashboard?upgraded=true`, `${window.location.origin}/pricing` ) window.location.href = response.checkout_url } catch (error) { console.error('Failed to create checkout:', error) setLoadingPlan(null) } } return (
{/* Background Effects - matching landing page */}
{/* Hero */}
Pricing

Pick your weapon.

Start free. Scale when you're ready. All plans include core features.

{/* Pricing Cards */}
{tiers.map((tier, index) => (
{/* Hover glow for non-highlighted */} {!tier.highlighted && (
)} {tier.badge && (
{tier.badge}
)}
{/* Header */}

{tier.name}

{tier.description}

{tier.price === '0' ? ( Free ) : ( <> ${tier.price} {tier.period} )}
{/* Features - flex-1 to push button to bottom */}
    {tier.features.map((feature) => (
  • {feature.available ? ( ) : ( )} {feature.text} {feature.sublabel && ( {feature.sublabel} )}
  • ))}
{/* CTA - always at bottom */}
))}
{/* Comparison Table */}

Compare Plans

{comparisonFeatures.map((feature) => ( ))}
Feature Scout Trader Tycoon
{feature.name} {feature.scout === 'check' ? ( ) : feature.scout} {feature.trader === 'check' ? ( ) : feature.trader} {feature.tycoon === 'check' ? ( ) : feature.tycoon}
{/* FAQ */}

Frequently Asked

{faqs.map((faq, i) => (
{expandedFaq === i && (

{faq.a}

)}
))}
{/* Bottom CTA */}

Not sure yet?

Start with Scout. It's free forever. Upgrade when you need more.

{isAuthenticated ? "Go to Dashboard" : "Get Started Free"}
) }