import React, { useState, useMemo, useRef } from 'react'; import { useNavigate } from 'react-router-dom'; import { Phone, CheckCircle, Clock, UserCheck, Activity, Filter, ChevronDown, BarChart3, HelpCircle, Mail, Sparkles, ArrowDown, Bot, Zap, Rocket, LineChart, Layers, Fingerprint, Network, MonitorPlay, Plus } from 'lucide-react'; import { Card, Button } from '../components/UI'; import { mockAssistants, getDashboardStats } from '../services/mockData'; export const DashboardPage: React.FC = () => { const navigate = useNavigate(); const [timeRange, setTimeRange] = useState<'week' | 'month' | 'year'>('week'); const [selectedAssistantId, setSelectedAssistantId] = useState('all'); const workflowRef = useRef(null); const aboutRef = useRef(null); const stats = useMemo(() => { return getDashboardStats(timeRange, selectedAssistantId); }, [timeRange, selectedAssistantId]); const scrollToNext = (ref: React.RefObject) => { ref.current?.scrollIntoView({ behavior: 'smooth' }); }; return (
{/* SECTION 1: METRICS & CHARTS */}
{/* 1. Top Utility Row (Separated) */}
{/* 2. Main Dashboard Container */}
{/* Decorative Background for Container */}
{/* Header Area */}

控制台

LIVE

实时监控智能体运行状态与业务核心指标

{/* Create Assistant CTA */}
{/* Filters Row */}
Data Overview
{(['week', 'month', 'year'] as const).map((r) => ( ))}
{/* Metrics Grid */}
} trend="+12.5%" color="cyan" /> } trend="+2.1%" color="emerald" /> } trend="-0.5%" color="blue" /> } trend="+5%" color="violet" />
{/* Chart Section */}

业务趋势分析

REAL-TIME
{/* Scroll Indicator */}
scrollToNext(workflowRef)} className="absolute bottom-6 left-1/2 -translate-x-1/2 flex flex-col items-center gap-3 cursor-pointer group animate-bounce-slow opacity-40 hover:opacity-100 transition-all duration-500" > Product Logic
{/* SECTION 2: WORKFLOW LOGIC */}
{/* Background Grid */}
System Architecture

全链路智能体生命周期

从构建到优化,为您提供一站式 AI 视频通话 解决方案闭环

{/* Connecting Line (Desktop) */}
} desc="配置人设、知识库与工具链" color="blue" /> } desc="在线调试、自动化压力测试" color="yellow" /> } desc="多端分发、API 极速接入" color="cyan" /> } desc="全量日志、核心指标监控" color="purple" />
{/* Scroll Indicator */}
scrollToNext(aboutRef)} className="absolute bottom-10 left-1/2 -translate-x-1/2 cursor-pointer opacity-30 hover:opacity-100 transition-opacity p-4" >
{/* SECTION 3: ABOUT */}
Powered by Gemini 2.0 & WebRTC

关于 AI 视频助手

致力打造下一代多模态实时交互体验,让 AI 像真人一样看、听、说。

} title="多模态融合" desc="文本、音频、视频流实时同步处理,毫秒级响应" /> } title="私有化知识" desc="深度集成 RAG 技术,确保企业数据安全可控" /> } title="低延迟架构" desc="全球节点加速,WebRTC 端到端加密传输" /> } title="极速集成" desc="提供完善的 SDK 与 API 文档,5分钟完成上线" />
© 2024 AI VIDEO ASSISTANT INC. ALL RIGHTS RESERVED.
); }; // --- Sub Components --- const StatCard: React.FC<{ title: string; subtitle: string; value: string; icon: React.ReactNode; trend?: string; color?: 'cyan' | 'emerald' | 'blue' | 'violet' }> = ({ title, subtitle, value, icon, trend, color = 'cyan' }) => { const colors = { cyan: { icon: "text-cyan-400", bg: "bg-cyan-500/10", border: "border-cyan-500/20", glow: "group-hover:shadow-[0_0_30px_-5px_rgba(34,211,238,0.3)]", text: "group-hover:text-cyan-400", trend: "text-cyan-400 bg-cyan-400/10 border-cyan-400/20" }, emerald: { icon: "text-emerald-400", bg: "bg-emerald-500/10", border: "border-emerald-500/20", glow: "group-hover:shadow-[0_0_30px_-5px_rgba(52,211,153,0.3)]", text: "group-hover:text-emerald-400", trend: "text-emerald-400 bg-emerald-400/10 border-emerald-400/20" }, blue: { icon: "text-blue-400", bg: "bg-blue-500/10", border: "border-blue-500/20", glow: "group-hover:shadow-[0_0_30px_-5px_rgba(96,165,250,0.3)]", text: "group-hover:text-blue-400", trend: "text-blue-400 bg-blue-400/10 border-blue-400/20" }, violet: { icon: "text-violet-400", bg: "bg-violet-500/10", border: "border-violet-500/20", glow: "group-hover:shadow-[0_0_30px_-5px_rgba(167,139,250,0.3)]", text: "group-hover:text-violet-400", trend: "text-violet-400 bg-violet-400/10 border-violet-400/20" } }; const theme = colors[color]; return (
{/* Decorative Background Blob */}
{React.cloneElement(icon as React.ReactElement, { className: `w-7 h-7 ${theme.icon}` })}
{trend && (
{trend}
)}

{title}

{subtitle}
{value}
); }; const WorkflowStep: React.FC<{ step: string; title: string; desc: string; icon: React.ReactNode; color: 'blue' | 'yellow' | 'cyan' | 'purple' }> = ({ step, title, desc, icon, color }) => { const colors = { blue: "text-blue-400 border-blue-500/30 hover:border-blue-400 hover:shadow-[0_0_30px_rgba(96,165,250,0.3)] bg-blue-500/10", yellow: "text-yellow-400 border-yellow-500/30 hover:border-yellow-400 hover:shadow-[0_0_30px_rgba(250,204,21,0.3)] bg-yellow-500/10", cyan: "text-cyan-400 border-cyan-500/30 hover:border-cyan-400 hover:shadow-[0_0_30px_rgba(34,211,238,0.3)] bg-cyan-500/10", purple: "text-purple-400 border-purple-500/30 hover:border-purple-400 hover:shadow-[0_0_30px_rgba(192,132,252,0.3)] bg-purple-500/10" }; return (
{icon}
{step}

{title}

{desc}

); }; const FeatureCard: React.FC<{ icon: React.ReactNode; title: string; desc: string }> = ({ icon, title, desc }) => (
{icon}

{title}

{desc}

); const SimpleAreaChart: React.FC<{ data: { label: string, value: number }[] }> = ({ data }) => { if (!data || data.length === 0) return null; const height = 300; const width = 1400; const padding = 30; const maxValue = Math.max(...data.map(d => d.value)) * 1.2; const points = data.map((d, i) => { const x = (i / (data.length - 1)) * (width - padding * 2) + padding; const y = height - (d.value / maxValue) * (height - padding * 2) - padding; return `${x},${y}`; }).join(' '); const firstPoint = points.split(' ')[0]; const lastPoint = points.split(' ')[points.split(' ').length - 1]; const fillPath = `${points} ${lastPoint.split(',')[0]},${height} ${firstPoint.split(',')[0]},${height}`; return (
{/* Grid Lines */} {[0.25, 0.5, 0.75].map(v => ( ))} {/* Area Fill Gradient */} {data.length < 32 && data.map((d, i) => { const x = (i / (data.length - 1)) * (width - padding * 2) + padding; const y = height - (d.value / maxValue) * (height - padding * 2) - padding; return ( ); })} {/* X-Axis Labels */}
{data.filter((_, i) => i % Math.ceil(data.length / 7) === 0).map((d, i) => ( {d.label} ))}
); };