'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import { ArrowLeft, CheckCircle, XCircle, Clock, Video, Filter, ChevronRight } from 'lucide-react' import { ResponsiveLayout } from '@/components/layout/ResponsiveLayout' import { cn } from '@/lib/utils' // 历史任务状态类型 type HistoryStatus = 'completed' | 'expired' | 'cancelled' // 历史任务数据类型 type HistoryTask = { id: string title: string description: string status: HistoryStatus completedAt?: string expiredAt?: string platform: string } // 模拟历史数据 const mockHistory: HistoryTask[] = [ { id: 'hist-001', title: 'MM春季护肤品推广', description: '产品测评 · 已发布', status: 'completed', completedAt: '2026-01-20', platform: '抖音', }, { id: 'hist-002', title: 'NN零食新品试吃', description: '美食测评 · 已发布', status: 'completed', completedAt: '2026-01-15', platform: '小红书', }, { id: 'hist-003', title: 'OO运动装备测评', description: '运动视频 · 已过期', status: 'expired', expiredAt: '2026-01-10', platform: '抖音', }, { id: 'hist-004', title: 'PP家居用品展示', description: '生活vlog · 已取消', status: 'cancelled', expiredAt: '2026-01-05', platform: 'B站', }, { id: 'hist-005', title: 'QQ电子产品开箱', description: '科技测评 · 已发布', status: 'completed', completedAt: '2025-12-28', platform: '抖音', }, { id: 'hist-006', title: 'RR母婴用品推荐', description: '种草视频 · 已发布', status: 'completed', completedAt: '2025-12-20', platform: '小红书', }, ] // 状态配置 const statusConfig: Record = { completed: { label: '已完成', color: 'text-accent-green', bgColor: 'bg-accent-green/15', icon: CheckCircle }, expired: { label: '已过期', color: 'text-text-tertiary', bgColor: 'bg-bg-elevated', icon: Clock }, cancelled: { label: '已取消', color: 'text-accent-coral', bgColor: 'bg-accent-coral/15', icon: XCircle }, } // 历史任务卡片 function HistoryCard({ task, onClick }: { task: HistoryTask; onClick: () => void }) { const status = statusConfig[task.status] const StatusIcon = status.icon return (
{task.title} {task.description}
{task.platform} {task.completedAt || task.expiredAt}
{status.label}
) } export default function CreatorHistoryPage() { const router = useRouter() const [filter, setFilter] = useState('all') const filteredHistory = filter === 'all' ? mockHistory : mockHistory.filter(t => t.status === filter) return (
{/* 顶部栏 */}

历史记录

查看已完成和过期的任务

{/* 统计信息 */}
{mockHistory.filter(t => t.status === 'completed').length} 已完成
{mockHistory.filter(t => t.status === 'expired').length} 已过期
{mockHistory.filter(t => t.status === 'cancelled').length} 已取消
{/* 任务列表 */}
{filteredHistory.map((task) => ( router.push(`/creator/task/${task.id}`)} /> ))}
) }