"use client"; import { useState, useEffect } from "react"; import { Link } from "@/i18n/navigation"; import { useTranslation } from "@/i18n/navigation"; import { CTA_CONFIG } from "@/config/course"; import { isPaid } from "@/app/lib/course-payment"; export function CTASection() { const { t } = useTranslation("community"); const [paid, setPaid] = useState(false); const [toast, setToast] = useState(false); useEffect(() => { setPaid(isPaid()); const onPayUpdate = () => setPaid(isPaid()); window.addEventListener("pay:updated", onPayUpdate); return () => window.removeEventListener("pay:updated", onPayUpdate); }, []); return (

{CTA_CONFIG.title}

{CTA_CONFIG.subtitle}

{CTA_CONFIG.badges.map((b, i) => ( {b} ))}
{paid ? ( 开始学习 → ) : ( )}
{toast && (
{t("updating")}
)}
); }