"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { AlertTriangle, FileText, LifeBuoy } from "lucide-react";
import { buttonVariants } from "@/components/ui/button";
export type SubscriptionRiskRestrictionNotice = {
id: string;
level: "WARNING" | "SUSPENDED";
reasonLabel: string;
message: string;
riskReport: string | null;
reportSentAt: string | null;
};
function supportHref(id: string) {
return "/support?riskEventId=" + encodeURIComponent(id);
}
export function SubscriptionRiskRestrictionGate({
restriction,
}: {
restriction: SubscriptionRiskRestrictionNotice | null;
}) {
const pathname = usePathname();
if (!restriction) return null;
const isSupportPath = pathname === "/support" || pathname.startsWith("/support/");
if (isSupportPath) {
return (
订阅风控限制处理中
请在工单中说明访问来源,解除前操作会受限。
订阅风控强制通知
检测到异常地区或 IP 访问。解除前请通过工单核验。
{restriction.message}
{restriction.riskReport}
)}
下一步
说明访问来源、所在地区和链接共享情况。