import { t } from "@lingui/core/macro"; import Button from "~/components/Button"; import { useModal } from "~/providers/modal"; export function CustomURLConfirmation({ workspacePublicId, }: { workspacePublicId: string; }) { const { closeModal, entityId } = useModal(); const handleUpgrade = async () => { try { const response = await fetch("/api/stripe/create_checkout_session", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ slug: entityId, workspacePublicId: workspacePublicId, cancelUrl: "/settings", successUrl: "/settings", }), }); const { url } = (await response.json()) as { url: string }; if (url) { window.location.href = url; } } catch (error) { console.error("Error creating checkout session:", error); } }; return (

{t`Confirm URL change`}

{t`Custom URLs are a premium feature. You'll be directed to upgrade your account.`}

); }