"use client"; import Link from "next/link"; import { ArrowRight, BellRing, CheckCircle2, Coins, Crown, Loader2, Lock, MessageSquare, TrendingUp, Wallet, X, } from "lucide-react"; export type UnlockProBilling = { pointsEnabled: boolean; isEligible: boolean; pointsUsed: number; discountAmount: number; finalPrice: number; maxDiscountUsd: number; pointsPerUsd: number; }; type UnlockProOverlayProps = { points: number; planPriceUsd: number; usePoints: boolean; billing: UnlockProBilling; onToggleUsePoints: () => void; onPay: () => void; onClose?: () => void; payBusy?: boolean; payLabel?: string; locale?: "zh-CN" | "en-US"; errorText?: string; infoText?: string; faqHref?: string; telegramGroupUrl?: string; }; export function UnlockProOverlay({ points, planPriceUsd, usePoints, billing, onToggleUsePoints, onPay, onClose, payBusy = false, payLabel, locale = "zh-CN", errorText, infoText, faqHref = "/account", telegramGroupUrl, }: UnlockProOverlayProps) { const isEn = locale === "en-US"; const title = isEn ? "Unlock PolyWeather Pro" : "解锁 PolyWeather Pro"; const subtitle = isEn ? "Get high-precision weather intelligence and full-platform alerts." : "获取全球最精准的高精度气象推送"; const finalPayLabel = payLabel || (isEn ? "Subscribe & Activate" : "立即订阅并激活服务"); return (
{onClose && ( )}

{title}

{subtitle}

STANDARD PRO
${planPriceUsd.toFixed(2)} / {isEn ? "mo" : "月"}
    {(isEn ? [ "15-day high precision trend", "Realtime radar panel", "Cross-platform alert push", ] : ["15天趋势预报", "实时雷达图", "全平台推送"] ).map((item, i) => (
  • {item}
  • ))}
{billing.pointsEnabled && billing.isEligible ? (
{isEn ? "Points Credit" : "积分抵扣"}
-${billing.discountAmount.toFixed(2)} DISCOUNT

{usePoints ? isEn ? `Using ${billing.pointsUsed} points from your account` : `已自动消耗账户内 ${billing.pointsUsed} 积分` : isEn ? `Enable to save up to $${billing.maxDiscountUsd.toFixed(2)}` : `开启后最多可抵扣 $${billing.maxDiscountUsd.toFixed(2)}`}

) : (
{!billing.pointsEnabled ? isEn ? "Points Disabled" : "积分未开启" : isEn ? "Not Enough Points" : "积分不足"}

{isEn ? "Earn Credits in Community" : "活跃赚取抵扣"}

{!billing.pointsEnabled ? isEn ? "Points redemption is currently unavailable for this plan." : "当前套餐未开启积分抵扣。" : isEn ? `Need at least ${billing.pointsPerUsd} points. Current: ${points}` : `需要至少 ${billing.pointsPerUsd} 积分,当前 ${points}`}

{telegramGroupUrl ? ( {isEn ? "Open Telegram" : "前往电报群"} ) : ( {isEn ? "Open Telegram" : "前往电报群"} )}
)}
{isEn ? "Total Due" : "应付总计"}
${billing.finalPrice.toFixed(2)} USD
Secure Payment Subscription FAQ
{errorText ? (
{errorText}
) : null} {infoText ? (
{infoText}
) : null}
); }