'use client' import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' import { Bell, CheckCircle, XCircle, Clock, ChevronDown, ChevronRight } from 'lucide-react' import { DesktopLayout } from '@/components/layout/DesktopLayout' import { MobileLayout } from '@/components/layout/MobileLayout' import { cn } from '@/lib/utils' type MessageStatus = 'info' | 'success' | 'error' const mockMessages = [ { id: 'msg-001', taskId: 'task-002', title: 'AI 审核通过', description: '已进入代理商审核,请等待最终结果。', time: '刚刚', status: 'success' as MessageStatus, read: false, }, { id: 'msg-002', taskId: 'task-003', title: 'AI 审核未通过', description: '检测到竞品 Logo 与绝对化用语,请修改后重新提交。', time: '10 分钟前', status: 'error' as MessageStatus, read: false, }, { id: 'msg-003', taskId: 'task-001', title: '等待提交脚本', description: '请先上传脚本,系统才能开始合规预审。', time: '1 小时前', status: 'info' as MessageStatus, read: true, }, ] const statusConfig: Record = { success: { icon: CheckCircle, color: 'text-accent-green', bg: 'bg-accent-green/15' }, error: { icon: XCircle, color: 'text-accent-coral', bg: 'bg-accent-coral/15' }, info: { icon: Clock, color: 'text-accent-indigo', bg: 'bg-accent-indigo/15' }, } function MessageCard({ title, description, time, status, isRead, onClick, }: { title: string description: string time: string status: MessageStatus isRead: boolean onClick: () => void }) { const Icon = statusConfig[status].icon return ( ) } export default function CreatorMessagesPage() { const router = useRouter() const [isMobile, setIsMobile] = useState(true) const [messages, setMessages] = useState(mockMessages) const [showRead, setShowRead] = useState(false) useEffect(() => { const checkMobile = () => setIsMobile(window.innerWidth < 1024) checkMobile() window.addEventListener('resize', checkMobile) return () => window.removeEventListener('resize', checkMobile) }, []) const handleClick = (messageId: string, taskId: string) => { setMessages((prev) => prev.map((msg) => (msg.id === messageId ? { ...msg, read: true } : msg)) ) router.push(`/creator/task/${taskId}`) } const unreadCount = messages.filter((msg) => !msg.read).length const unreadMessages = messages.filter((msg) => !msg.read) const readMessages = messages.filter((msg) => msg.read) const DesktopContent = (

消息中心

追踪 AI 审核与人工审核进度

未读 {unreadCount}
{unreadMessages.length === 0 && (
暂无未读消息
)} {unreadMessages.map((msg) => ( handleClick(msg.id, msg.taskId)} /> ))}
{showRead && readMessages.length === 0 && (
暂无已读消息
)} {showRead && readMessages.map((msg) => ( handleClick(msg.id, msg.taskId)} /> ))}
) const MobileContent = (

消息中心

审核进度提醒

{unreadMessages.length === 0 && (
暂无未读消息
)} {unreadMessages.map((msg) => ( handleClick(msg.id, msg.taskId)} /> ))} {showRead && readMessages.length === 0 && (
暂无已读消息
)} {showRead && readMessages.map((msg) => ( handleClick(msg.id, msg.taskId)} /> ))}
) return isMobile ? MobileContent : DesktopContent }