"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 (
{subtitle}
{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 redemption is currently unavailable for this plan." : "当前套餐未开启积分抵扣。" : isEn ? `Need at least ${billing.pointsPerUsd} points. Current: ${points}` : `需要至少 ${billing.pointsPerUsd} 积分,当前 ${points}`}