"use client"; import { useState, useEffect } from "react"; import Link from "next/link"; import { CTA_CONFIG } from "../../config/course"; import { isPaid } from "../../lib/payment"; import { triggerPay } from "@/app/lib/triggerPay"; export function CTASection() { const [paid, setPaid] = 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 ? ( 开始学习 → ) : ( )}
); }