"use client" import type React from "react" import { useState } from "react" import { Card, CardContent } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { useRouter } from "next/navigation" import { ThumbsUp, Clock, Send, Users, Share2, MessageSquare, BarChart3, Target, TrendingUp } from "lucide-react" // 功能项数据类型 interface WorkspaceFunction { id: string title: string description: string icon: React.ReactNode path: string isNew?: boolean color: string bgColor: string } // 常用功能数据 const commonFunctions: WorkspaceFunction[] = [ { id: "auto-like", title: "自动点赞", description: "智能自动点赞互动", icon: , path: "/workspace/auto-like", isNew: true, color: "text-red-600", bgColor: "bg-red-50", }, { id: "moments-sync", title: "朋友圈同步", description: "自动同步朋友圈内容", icon: , path: "/workspace/moments-sync", color: "text-purple-600", bgColor: "bg-purple-50", }, { id: "group-push", title: "群消息推送", description: "智能群发助手", icon: , path: "/workspace/group-push", color: "text-orange-600", bgColor: "bg-orange-50", }, { id: "auto-group", title: "自动建群", description: "智能拉好友建群", icon: , path: "/workspace/auto-group", color: "text-green-600", bgColor: "bg-green-50", }, { id: "traffic-distribution", title: "流量分发", description: "管理流量分发和分配", icon: , path: "/workspace/traffic-distribution", color: "text-blue-600", bgColor: "bg-blue-50", }, { id: "ai-assistant", title: "AI对话助手", description: "智能回复,提高互动质量", icon: , path: "/workspace/ai-assistant", isNew: true, color: "text-blue-600", bgColor: "bg-blue-50", }, ] // AI智能助手功能数据 const aiFunctions: WorkspaceFunction[] = [ { id: "ai-analyzer", title: "AI数据分析", description: "智能分析客户行为特征", icon: , path: "/workspace/ai-analyzer", isNew: true, color: "text-blue-600", bgColor: "bg-blue-50", }, { id: "ai-strategy", title: "AI策略优化", description: "智能优化获客策略", icon: , path: "/workspace/ai-strategy", isNew: true, color: "text-cyan-600", bgColor: "bg-cyan-50", }, { id: "ai-prediction", title: "AI销售预测", description: "智能预测销售趋势", icon: , path: "/workspace/ai-prediction", color: "text-yellow-600", bgColor: "bg-yellow-50", }, ] export default function WorkspacePage() { const router = useRouter() const [accessStats, setAccessStats] = useState>({}) // 记录功能访问 const recordAccess = async (functionId: string) => { try { // 这里可以调用API记录访问统计 setAccessStats((prev) => ({ ...prev, [functionId]: (prev[functionId] || 0) + 1, })) } catch (error) { console.error("记录访问失败:", error) } } // 处理功能点击 const handleFunctionClick = (func: WorkspaceFunction) => { recordAccess(func.id) router.push(func.path) } // 功能卡片组件 const FunctionCard = ({ func }: { func: WorkspaceFunction }) => ( handleFunctionClick(func)} > {func.icon} {func.isNew && New} {func.title} {func.description} ) return ( {/* 顶部标题 */} 工作台 {/* 常用功能 */} 常用功能 {commonFunctions.map((func) => ( ))} {/* AI智能助手 */} AI智能助手 {aiFunctions.map((func) => ( ))} ) }
{func.description}