"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 subscription required", zh: "需要开通 Pro" }, month: { en: "/ 30 days", zh: "/ 30 天" }, subscribeNow: { en: "View Pro plans", zh: "查看订阅方案" }, 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 station, METAR, and runway signals", "DEB forecast curves and model comparison", "Full terminal grid with high-frequency refresh", "API and paid Telegram group access on paid Pro", ] : [ "实时气象站、METAR 与跑道信号", "DEB 预测曲线与模型对比", "完整终端网格与高频刷新", "付费 Pro 可进入 API 与付费 Telegram 群", ]; return (
{t("proAccessRequired", isEn)}

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

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

29.9 USDC {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 (
); }