"use client" import Link from "next/link" import { useState } from "react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Textarea } from "@/components/ui/textarea" import { Cpu, BarChart3, TrendingUp, Users, Target, Brain, ArrowRight, Send, Sparkles } from 'lucide-react' export default function AIAssistant() { const [message, setMessage] = useState("") const [chatHistory, setChatHistory] = useState([ { role: "assistant", content: "你好!我是神射手AI助手,可以帮助你分析用户数据、生成报告、预测趋势。有什么我可以帮助你的吗?", timestamp: "10:30", }, ]) // AI功能卡片 const aiFeatures = [ { icon: , title: "数据分析", description: "自动分析用户行为,生成洞察报告", color: "from-blue-500 to-cyan-500", href: "/platform/ai-assistant/data-analysis", stats: { reports: 1258, insights: 856 } }, { icon: , title: "趋势预测", description: "预测用户行为和价值变化趋势", color: "from-purple-500 to-pink-500", href: "/platform/ai-assistant/trend-prediction", stats: { accuracy: 94.2, predictions: 2450 } }, { icon: , title: "用户画像", description: "智能生成用户群体画像", color: "from-green-500 to-emerald-500", href: "/platform/ai-assistant/user-profiling", stats: { profiles: 4285, segments: 128 } }, { icon: , title: "精准推荐", description: "推荐最佳营销策略和用户群", color: "from-orange-500 to-red-500", href: "/platform/ai-assistant/recommendation", stats: { campaigns: 586, conversion: 18.5 } }, ] // 快捷问题 const quickQuestions = [ "分析今日新增用户特征", "预测本月用户增长趋势", "高价值用户流失预警", "生成本周运营报告", ] const handleSend = () => { if (!message.trim()) return setChatHistory([ ...chatHistory, { role: "user", content: message, timestamp: new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" }), }, { role: "assistant", content: "正在分析您的问题,请稍候...", timestamp: new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" }), }, ]) setMessage("") } return (
{/* Header */}

AI智能助手

数据分析、报告生成与智能预测

{/* AI状态 */} AI运行状态
系统状态
运行中
模型版本 v3.5
响应速度 0.8s
准确率 94.2%
{/* AI功能卡片 */}
{aiFeatures.map((feature, index) => (
{feature.icon}

{feature.title}

{feature.description}

{Object.entries(feature.stats).map(([key, value], i) => (
{key === 'reports' ? '报告数' : key === 'insights' ? '洞察数' : key === 'accuracy' ? '准确率' : key === 'predictions' ? '预测数' : key === 'profiles' ? '画像数' : key === 'segments' ? '分组数' : key === 'campaigns' ? '活动数' : '转化率'}
{typeof value === 'number' && value % 1 !== 0 ? `${value}%` : value}
))}
))}
{/* 对话区域 */}
AI对话 {/* 聊天历史 */}
{chatHistory.map((chat, index) => (
{chat.content}
{chat.timestamp}
))}
{/* 快捷问题 */}
{quickQuestions.map((question, index) => ( ))}
{/* 输入框 */}