Terminal
{t("signInToContinue", isEn)}
{isEn ? "The weather terminal is for verified subscribers only." : "天气决策台仅对已验证的付费用户开放。"}
"use client"; import Link from "next/link"; import { AlertTriangle, CreditCard, LogIn, RefreshCw, } from "lucide-react"; const ACCESS_TERM = { signInToContinue: { en: "Sign in to continue", zh: "请先登录" }, proAccessRequired: { en: "Subscription expired", zh: "订阅已过期", }, month: { en: "/ 30 days", zh: "/ 30 天" }, subscribeNow: { en: "Renew and restore access", 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; } function isExpiredSubscription(expiresAt?: string | null) { if (!expiresAt) return false; const timestamp = Date.parse(expiresAt); return Number.isFinite(timestamp) && timestamp <= Date.now(); } function formatSubscriptionDate(expiresAt: string | null | undefined, isEn: boolean) { if (!expiresAt) return ""; const timestamp = Date.parse(expiresAt); if (!Number.isFinite(timestamp)) return ""; try { return new Intl.DateTimeFormat(isEn ? "en-US" : "zh-CN", { day: "2-digit", month: "short", year: "numeric", }).format(new Date(timestamp)); } catch { return ""; } } // ─── Layer 2: Authenticated but no active subscription ─────────────────────── function SubscriptionGate({ isEn, subscriptionExpiresAt, }: { isEn: boolean; subscriptionExpiresAt?: string | null; }) { const expired = isExpiredSubscription(subscriptionExpiresAt); const expiryLabel = formatSubscriptionDate(subscriptionExpiresAt, isEn); 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 (
{isEn ? "Access paused" : "终端访问已暂停"}
{isEn ? "Your account is verified, but it does not currently have an active subscription. Renewing restores live temperature evidence, DEB paths, runway alerts, and paid Telegram/API access." : "你的账号已验证,但当前没有有效订阅。续费后会立即恢复实时温度、DEB 路径、跑道提醒和付费 Telegram/API 权益。"}
{isEn ? "Already paid but still blocked?" : "已有付款但未恢复?"}
{isEn ? "Access resumes automatically after payment confirmation" : "付款确认后会自动恢复访问"}
Terminal
{isEn ? "The weather terminal is for verified subscribers only." : "天气决策台仅对已验证的付费用户开放。"}
Terminal