"use client"; import Link from "next/link"; import { LockKeyhole, CreditCard, LogIn } from "lucide-react"; const ACCESS_TERM = { signInToContinue: { en: "Sign in to continue", zh: "请先登录" }, proAccessRequired: { en: "Pro Access Required", zh: "需要付费订阅" }, month: { en: "/ month", zh: "/ 月" }, subscribeNow: { en: "Subscribe Now — $10/mo", zh: "立即订阅 — $10/月" }, backToProduct: { en: "Back to product overview", zh: "返回产品介绍页" }, } as const; function t(key: keyof typeof ACCESS_TERM, isEn: boolean) { return isEn ? ACCESS_TERM[key].en : ACCESS_TERM[key].zh; } // ─── Layer 2: Authenticated but no active subscription ─────────────────────── function SubscriptionGate({ isEn }: { isEn: boolean }) { const features = isEn ? [ "Real-time METAR observations across 500+ stations", "DEB forecast blends with 0–240h horizon", "AI decision cards with Poly-score ranking", "Historical backtesting & weather signals", ] : [ "500+ 气象站实时 METAR 实况", "DEB 智能融合预测(0–240 小时)", "AI 决策卡片 + Poly-score 排名", "历史回测与天气信号", ]; return (
{t("proAccessRequired", isEn)}

{isEn ? "Unlock the Weather Terminal" : "解锁天气决策台"}

{isEn ? "Your account is verified. One step away from full access." : "账号已验证,只差一步即可获得完整访问权限。"}

$10 {t("month", isEn)}
    {features.map((f) => (
  • {f}
  • ))}
{t("subscribeNow", isEn)}

{isEn ? "Cancel anytime · No hidden fees · Instant access after payment" : "随时取消 · 无隐藏费用 · 付款后立即解锁"}

← {t("backToProduct", isEn)}
); } // ─── Layer 1 fallback: Should not normally appear (middleware handles it) ───── function UnauthenticatedGate({ isEn, userLocalTime, }: { isEn: boolean; userLocalTime: string; }) { return (
); } export function ProductAccessRequired({ isAuthenticated, isEn, userLocalTime, }: { isAuthenticated: boolean; isEn: boolean; userLocalTime: string; }) { if (!isAuthenticated) { return ; } return (
); }