mie a jour de la des mots du jour,

optimisation de la latence des pages
ajout d'option  clique droit plus paragraphe
This commit is contained in:
2026-03-14 20:45:59 +01:00
parent 1f77255a6b
commit 12de3a8328
28 changed files with 492 additions and 178 deletions

View File

@@ -29,9 +29,29 @@ export default function PricingPage() {
<Pricing
plans={plans}
isLoading={isLoading}
currentPlan={user?.subscription.plan || 'free'}
currentPlan={user?.planId || 'free'}
onBack={() => router.push(user ? '/dashboard' : '/')}
onSelectPlan={(id) => router.push(user ? `/checkout?plan=${id}` : '/login')}
onSelectPlan={async (id) => {
if (!user) {
router.push('/login');
return;
}
try {
const response = await fetch('/api/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ planId: id })
});
const data = await response.json();
if (data.url) {
window.location.href = data.url;
}
} catch (err) {
console.error('Checkout error:', err);
}
}}
/>
);
}