'use client'; import React, { useState } from 'react'; import Image from 'next/image'; import { Link } from '@/i18n/navigation'; import { useTranslations, useLocale } from 'next-intl'; import { Check, X, ArrowRight, Shield } from 'lucide-react'; type BillingInterval = 'monthly' | 'yearly'; type PlanKey = 'bronze' | 'silver' | 'gold' | 'platinium'; interface FeatureRow { key: string; included: boolean; } interface PlanConfig { key: PlanKey; monthlyPrice: number; yearlyPrice: number; maxUsersKey: 'unlimited' | null; maxUsers?: number; shipmentsKey: 'shipmentsPerYear' | 'shipmentsUnlimited'; commission: string; supportKey: 'supportNone' | 'supportEmail' | 'supportDirect' | 'supportKam'; badge: 'silver' | 'gold' | 'platinium' | null; ctaStyle: string; popular: boolean; features: FeatureRow[]; } const PLANS: PlanConfig[] = [ { key: 'bronze', monthlyPrice: 0, yearlyPrice: 0, maxUsers: 1, maxUsersKey: null, shipmentsKey: 'shipmentsPerYear', commission: '5%', supportKey: 'supportNone', badge: null, ctaStyle: 'bg-gray-900 text-white hover:bg-gray-800', popular: false, features: [ { key: 'rates', included: true }, { key: 'bookings', included: true }, { key: 'dashboard', included: false }, { key: 'wiki', included: false }, { key: 'userManagement', included: false }, { key: 'csvImport', included: false }, { key: 'apiAccess', included: false }, { key: 'customUI', included: false }, { key: 'dedicatedKam', included: false }, ], }, { key: 'silver', monthlyPrice: 249, yearlyPrice: 2739, maxUsers: 5, maxUsersKey: null, shipmentsKey: 'shipmentsUnlimited', commission: '3%', supportKey: 'supportEmail', badge: 'silver', ctaStyle: 'bg-brand-turquoise text-white hover:opacity-90', popular: true, features: [ { key: 'rates', included: true }, { key: 'bookings', included: true }, { key: 'dashboard', included: true }, { key: 'wiki', included: true }, { key: 'userManagement', included: true }, { key: 'csvImport', included: true }, { key: 'apiAccess', included: false }, { key: 'customUI', included: false }, { key: 'dedicatedKam', included: false }, ], }, { key: 'gold', monthlyPrice: 899, yearlyPrice: 9889, maxUsers: 20, maxUsersKey: null, shipmentsKey: 'shipmentsUnlimited', commission: '2%', supportKey: 'supportDirect', badge: 'gold', ctaStyle: 'bg-yellow-500 text-white hover:bg-yellow-600', popular: false, features: [ { key: 'rates', included: true }, { key: 'bookings', included: true }, { key: 'dashboard', included: true }, { key: 'wiki', included: true }, { key: 'userManagement', included: true }, { key: 'csvImport', included: true }, { key: 'apiAccess', included: true }, { key: 'customUI', included: false }, { key: 'dedicatedKam', included: false }, ], }, { key: 'platinium', monthlyPrice: -1, yearlyPrice: -1, maxUsersKey: 'unlimited', shipmentsKey: 'shipmentsUnlimited', commission: '1%', supportKey: 'supportKam', badge: 'platinium', ctaStyle: 'bg-purple-600 text-white hover:bg-purple-700', popular: false, features: [ { key: 'rates', included: true }, { key: 'bookings', included: true }, { key: 'dashboard', included: true }, { key: 'wiki', included: true }, { key: 'userManagement', included: true }, { key: 'csvImport', included: true }, { key: 'apiAccess', included: true }, { key: 'customUI', included: true }, { key: 'dedicatedKam', included: true }, ], }, ]; export default function PricingPage() { const t = useTranslations('marketing.pricing'); const locale = useLocale(); const numberLocale = locale === 'fr' ? 'fr-FR' : 'en-US'; const [billing, setBilling] = useState('monthly'); const formatPrice = (amount: number): string => new Intl.NumberFormat(numberLocale, { style: 'currency', currency: 'EUR', minimumFractionDigits: 0, maximumFractionDigits: 0, }).format(amount); return (
{/* Header */}
Xpeditis
{t('header.login')} {t('header.register')}
{/* Hero */}

{t('hero.title')}

{t('hero.subtitle')}

{/* Billing toggle */}
{t('hero.monthly')} {t('hero.yearly')} {billing === 'yearly' && ( {t('hero.yearlyBadge')} )}
{/* Plans grid */}
{PLANS.map((plan) => (
{plan.popular && (
{t('popular')}
)} {/* Plan name & badge */}

{t(`plans.${plan.key}.name`)}

{plan.badge && ( )}

{t(`plans.${plan.key}.description`)}

{/* Price */}
{plan.monthlyPrice === -1 ? (

{t('currency.onQuote')}

) : plan.monthlyPrice === 0 ? (

{t('currency.free')}

) : ( <>

{billing === 'monthly' ? formatPrice(plan.monthlyPrice) : formatPrice(Math.round(plan.yearlyPrice / 12))} {t('currency.perMonth')}

{billing === 'yearly' && (

{t('currency.yearlyPrice', { price: formatPrice(plan.yearlyPrice) })}

)} )}
{/* Quick stats */}
{t('stats.users')} {plan.maxUsersKey ? t(`values.${plan.maxUsersKey}`) : plan.maxUsers}
{t('stats.shipments')} {t(`values.${plan.shipmentsKey}`)}
{t('stats.commission')} {plan.commission}
{t('stats.support')} {t(`values.${plan.supportKey}`)}
{/* Features */}
{plan.features.map((feature) => (
{feature.included ? ( ) : ( )} {t(`features.${feature.key}` as any)}
))}
{/* CTA */} {t(`plans.${plan.key}.cta`)}
))}
{/* Footer */}
); }