"use client"; import Link from "next/link"; import { ArrowRight, BarChart3, Crown, Lock, ShieldCheck, Sparkles, X, Zap, } from "lucide-react"; import { useI18n } from "@/hooks/useI18n"; import { useDashboardStore } from "@/hooks/useDashboardStore"; import { useState } from "react"; type ProFeaturePaywallProps = { feature: "today" | "history" | "future"; onClose?: () => void; }; export function ProFeaturePaywall({ feature, onClose, }: ProFeaturePaywallProps) { const { locale } = useI18n(); const { proAccess } = useDashboardStore(); const [usePoints, setUsePoints] = useState(true); const isEn = locale === "en-US"; // Redemption logic: 500 points = $1 discount // Max discount $3 (requires 1500 points) const maxRedeemablePoints = 1500; const pointsAvailable = proAccess.points || 0; const effectivePoints = Math.min(pointsAvailable, maxRedeemablePoints); const discountAmount = usePoints ? Math.floor(effectivePoints / 500) : 0; const originalPrice = 5.0; const finalPrice = originalPrice - discountAmount; const pointsToConsume = discountAmount * 500; return (
{isEn ? "Unlock 15-day precision trends, real-time radar, and ad-free experience across all platforms." : "解锁 15 天高精度趋势分析、实时雷达与闪电追踪。尊享全平台无广告体验。"}