Allow logout from upgrade panel

This commit is contained in:
Arthur Belleville 2025-12-01 22:45:54 +01:00
parent ce11d37a9d
commit 3a3fdd2837
No known key found for this signature in database

View file

@ -10,6 +10,7 @@ import { Text } from "@xtablo/ui/components/typography";
import { AlertCircle, CheckCircle2, CreditCard, Loader2Icon, Sparkles } from "lucide-react";
import { useUpgradeBlock } from "../contexts/UpgradeBlockContext";
import { useCreateCheckoutSession } from "../hooks/stripe";
import { useLogout } from "../hooks/auth";
/**
* Blocking upgrade panel that appears when users are past their trial period
@ -18,6 +19,7 @@ import { useCreateCheckoutSession } from "../hooks/stripe";
export function UpgradePanel() {
const { isBlocked } = useUpgradeBlock();
const { mutate: createCheckout, isPending: checkoutPending } = useCreateCheckoutSession();
const { mutate: signOut } = useLogout();
const STANDARD_MONTHLY_PRICE_ID = import.meta.env.VITE_STRIPE_STANDARD_MONTHLY_PRICE_ID || "";
@ -105,6 +107,13 @@ export function UpgradePanel() {
>
Contactez-nous
</a>
{" | "}
<a
onClick={() => signOut()}
className="text-primary hover:underline cursor-pointer font-medium"
>
Se déconnecter
</a>
</Text>
</div>
</CardContent>