fix: Stripe billing portal auto-config programmatique, separation changer-forfait vs gerer-facturation
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled

This commit is contained in:
2026-05-31 22:45:45 +02:00
parent 00c54997bf
commit ab296ea259
2 changed files with 88 additions and 11 deletions

View File

@@ -278,13 +278,22 @@ export default function ProfilePage() {
</div>
{!isFreePlan && (
<button
onClick={handleBillingPortal}
disabled={loadingPortal}
className="relative z-10 px-10 py-4 bg-white text-brand-dark rounded-xl font-black text-[10px] uppercase tracking-widest shadow-xl hover:scale-105 transition-all shrink-0 disabled:opacity-50"
>
{loadingPortal ? <RefreshCw className="w-4 h-4 animate-spin" /> : t('profile.subscription.changePlan')}
</button>
<div className="relative z-10 flex flex-col sm:flex-row gap-3">
{/* Change plan → pricing page */}
<Link href="/pricing">
<button className="px-10 py-4 bg-white text-brand-dark rounded-xl font-black text-[10px] uppercase tracking-widest shadow-xl hover:scale-105 transition-all shrink-0">
{t('profile.subscription.changePlan')}
</button>
</Link>
{/* Billing portal → invoices / cancel / payment method */}
<button
onClick={handleBillingPortal}
disabled={loadingPortal}
className="px-10 py-4 bg-white/10 border border-white/20 text-white rounded-xl font-black text-[10px] uppercase tracking-widest hover:bg-white/20 transition-all shrink-0 disabled:opacity-50"
>
{loadingPortal ? <RefreshCw className="w-4 h-4 animate-spin inline" /> : t('profile.subscription.manageBilling')}
</button>
</div>
)}
{isFreePlan && (
<Link href="/pricing">