'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, AlertCircle, Shield } from 'lucide-react' import Link from 'next/link' import clsx from 'clsx' const tiers = [ { id: 'scout', name: 'Scout', icon: Zap, price: '0', period: '', description: 'Recon access. No commitment.', features: [ { text: 'Market Feed', highlight: false, available: true, sublabel: 'Raw' }, { text: 'Alert Speed', highlight: false, available: true, sublabel: 'Daily' }, { text: '5 Watchlist Domains', highlight: false, available: true }, { text: '2 Sniper Alerts', highlight: false, available: true }, { text: 'TLD Intel', highlight: false, available: true, sublabel: 'Public' }, { text: 'Pounce Score', highlight: false, available: false }, { text: 'Marketplace', highlight: false, available: true, sublabel: 'Buy Only' }, { text: 'Yield (Beta)', highlight: false, available: false }, ], cta: 'Enter Terminal', highlighted: false, badge: null, isPaid: false, }, { id: 'trader', name: 'Trader', icon: TrendingUp, price: '9', period: '/mo', description: 'Cut noise. Move faster.', features: [ { text: 'Market Feed', highlight: true, available: true, sublabel: 'Curated' }, { text: 'Alert Speed', highlight: true, available: true, sublabel: 'Hourly' }, { text: '50 Watchlist Domains', highlight: true, available: true }, { text: '10 Sniper Alerts', highlight: true, available: true }, { text: 'TLD Intel', highlight: true, available: true, sublabel: 'Renewal Prices' }, { text: 'Pounce Score', highlight: true, available: true }, { text: '5 Listings', highlight: true, available: true, sublabel: '0% Fee' }, { text: 'Portfolio', highlight: true, available: true, sublabel: '25 Domains' }, { text: 'Yield (Beta)', highlight: false, available: true, sublabel: 'Optional' }, ], cta: 'Upgrade to Trader', highlighted: true, badge: 'Best Value', isPaid: true, }, { id: 'tycoon', name: 'Tycoon', icon: Crown, price: '29', period: '/mo', description: 'Full firepower. Priority alerts.', features: [ { text: 'Market Feed', highlight: true, available: true, sublabel: 'Priority' }, { text: 'Alert Speed', highlight: true, available: true, sublabel: '10 min' }, { text: '500 Watchlist Domains', highlight: true, available: true }, { text: '50 Sniper Alerts', highlight: true, available: true }, { text: 'TLD Intel', highlight: true, available: true, sublabel: 'Full History' }, { text: 'Score + SEO Data', highlight: true, available: true }, { text: '50 Listings', highlight: true, available: true, sublabel: 'Featured' }, { text: 'Unlimited Portfolio', highlight: true, available: true }, { text: 'Yield (Beta)', highlight: false, available: true, sublabel: 'Optional' }, ], cta: 'Go Tycoon', highlighted: false, badge: 'Full Power', isPaid: true, }, ] const comparisonFeatures = [ { name: 'Market Feed', scout: 'Raw (Unfiltered)', trader: 'Curated (Spam-Free)', tycoon: 'Curated + Priority' }, { name: 'Alert Speed', scout: 'Daily', trader: 'Hourly', tycoon: 'Every 10 minutes' }, { name: 'Watchlist', scout: '5 Domains', trader: '50 Domains', tycoon: '500 Domains' }, { name: 'Sniper Alerts', scout: '2', trader: '10', tycoon: '50' }, { name: 'TLD Intel', scout: 'Public Trends', trader: 'Renewal Prices', tycoon: 'Full History' }, { name: 'Valuation', scout: 'Locked', trader: 'Pounce Score', tycoon: 'Score + SEO' }, { name: 'Marketplace', scout: 'Buy Only', trader: '5 Listings (0% Fee)', tycoon: '50 Featured' }, { name: 'Portfolio', scout: '—', trader: '25 Domains', tycoon: 'Unlimited' }, { name: 'Yield (Beta)', scout: '—', trader: 'Optional', tycoon: 'Optional' }, ] 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) const [showCancelledBanner, setShowCancelledBanner] = useState(false) useEffect(() => { checkAuth() // Check if user cancelled checkout if (typeof window !== 'undefined') { const params = new URLSearchParams(window.location.search) if (params.get('cancelled') === 'true') { setShowCancelledBanner(true) // Clean up URL window.history.replaceState({}, '', '/pricing') } } }, [checkAuth]) const handleSelectPlan = async (planId: string, isPaid: boolean) => { if (!isAuthenticated) { router.push(`/register?redirect=/pricing`) return } if (!isPaid) { router.push('/terminal/hunt') return } setLoadingPlan(planId) try { const response = await api.createCheckoutSession( planId, `${window.location.origin}/terminal/welcome?plan=${planId}`, `${window.location.origin}/pricing?cancelled=true` ) window.location.href = response.checkout_url } catch (error) { console.error('Failed to create checkout:', error) setLoadingPlan(null) } } return (
{/* Background Effects - matching landing page */}
{/* Cancelled Banner */} {showCancelledBanner && (

Transaction Cancelled

Operation aborted. No charges applied. Resume when ready.

)} {/* Hero */}
Clearance Levels

Pick your weapon.

Enter Terminal. Upgrade when you need speed, filters, and deeper intel.

{/* Pricing Cards */}
{tiers.map((tier, index) => (
{/* Tech Corners for Highlighted */} {tier.highlighted && ( <>
)} {tier.badge && (
{tier.badge}
)}
{/* Header */}

{tier.name}

{tier.price === '0' ? ( Free ) : ( <> ${tier.price} {tier.period} )}

{tier.description}

{/* Features */}
    {tier.features.map((feature) => (
  • {feature.available ? (
    ) : (
    )} {feature.text} {feature.sublabel && ( {feature.sublabel} )}
  • ))}
{/* CTA */}
))}
{/* Comparison Table */}

Spec Sheet

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

Mission Support

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

{faq.a}

))}
{/* Bottom CTA */}

Not ready to commit?

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

{isAuthenticated ? "Command Center" : "Join the Hunt"}
) }