"use client"; import { useEffect, useState } from "react"; import dynamic from "next/dynamic"; import { RefreshCcw } from "lucide-react"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { opsApi } from "@/lib/ops-api"; const AnalyticsFunnelChart = dynamic( () => import("./AnalyticsFunnelChart").then((mod) => mod.AnalyticsFunnelChart), { ssr: false, loading: () =>
, }, ); type FunnelStep = { key: string; label: string; count: number; uniqueActors: number; pct_of_prev?: number; }; type TopItem = { name: string; count: number }; type AuthDiagnostic = { total?: number; unique_actors?: number; by_reason?: TopItem[]; }; export function AnalyticsPageClient() { const [loading, setLoading] = useState(true); const [funnel, setFunnel] = useState暂无 degraded_auth_profile
) : (暂无数据
) : (| 阶段 | 次数 | 独立用户/访客 | 转化率 | 流失率 |
|---|---|---|---|---|
| {step.label} | {step.count} | {step.uniqueActors} | {pct != null ? `${pct}%` : "—"} | {i > 0 ? `${dropPct}%` : "—"} |
rates 以 unique actors 计算,次数用于观察重复尝试和重试行为。
) : null}