{/* Header */}
{loading ? (
{/* FAQ / footer note */}
{/* ── Confirm plan modal ──────────────────────────────────────────────── */}
{confirmPlan && (
{t('pricing.title', 'Pricing')}
{t('pricing.subtitle')}
{t('common.loading', 'Loading...')}
) : (
<>
{/* Plan cards */}
{plans.map((plan) => {
const isCurrentPlan = plan.id === currentPlanId
const isFree = plan.tier === 'free'
return (
{/* Feature comparison table */}
{/* Tier badge + current label */}
{isCurrentPlan && (
{t('pricing.current_plan', 'Your plan')}
)}
{plan.tier === 'pro' && !isCurrentPlan && (
{t('pricing.popular', 'Popular')}
)}
)
})}
{plan.name}
{plan.description}
{/* Price */}
{isFree ? t('pricing.free', 'Free') : (
<>
{plan.oldPrice && (
€{plan.oldPrice}
)}
€{plan.price}
>
)}
{!isFree && (
/{t('pricing.per_month', 'month')}
)}
{plan.durationDays && !isFree && (
{t('pricing.duration', 'Duration')}: {plan.durationDays} {t('pricing.days', 'days')}
)} {isFree && } {/* CTA */}
{isCurrentPlan ? (
{t('pricing.your_plan', 'Current plan')}
) : isFree ? (
{t('pricing.free_default', 'Default')}
) : (
)}
{t('pricing.compare', 'Feature comparison')}
| {t('pricing.feature', 'Feature')} | {plans.map((plan) => (
|
))}
|---|---|
| {t(labelKey, labelKey)} | {plans.map((plan) => { const val = plan[key] let cell: React.ReactNode if (format) { cell = {format(val)} } else if (typeof val === 'boolean') { cell = val ?{cell} | ) })}
{t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.')}
> )}{t('pricing.confirm.title', 'Confirm plan selection')}
{previewLoading ? ({t('common.loading', 'Loading...')}
) : preview ? (
{t('pricing.confirm.plan', 'Plan')}
{confirmPlan.name}
{preview.type === 'upgrade' && Number(preview.prorated) > 0 && (
{t('pricing.confirm.prorated', 'Prorated credit')}
−€{preview.prorated}
)}
{preview.type !== 'downgrade' && (
{t('pricing.confirm.effective_price', 'To pay')}
€{preview.effectivePrice}
)}
{preview.type !== 'downgrade' && (
{t('pricing.confirm.your_balance', 'Your balance')}
€{preview.currentBalance}
)}
{preview.type === 'downgrade' && (
{t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.')}
{preview.scheduledDate && (
<> {new Date(preview.scheduledDate).toLocaleDateString('ru-RU')}>
)}
)}
{preview.type !== 'downgrade' && !preview.canPayFromBalance && (
{t('pricing.confirm.insufficient', 'Insufficient balance.')}
{' '}
setConfirmPlan(null)}>
{t('pricing.confirm.top_up', 'Top up')}
)}
{(preview.type === 'downgrade' || preview.canPayFromBalance) && (
)}