"use client" import { useState } from "react" import { Sidebar } from "@/components/sidebar" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Input } from "@/components/ui/input" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { FileText, Calendar, Search, Eye, Download, Trash2 } from "lucide-react" import Link from "next/link" // 模擬歷史記錄數據 const mockHistory = [ { id: "1", title: "產品介紹簡報", type: "PPT", score: 82, grade: "B+", date: "2024-01-15", status: "completed", }, { id: "2", title: "市場分析報告", type: "Website", score: 76, grade: "B", date: "2024-01-12", status: "completed", }, { id: "3", title: "產品演示影片", type: "Video", score: 88, grade: "A-", date: "2024-01-10", status: "completed", }, { id: "4", title: "技術架構說明", type: "PPT", score: 0, grade: "-", date: "2024-01-08", status: "processing", }, { id: "5", title: "用戶體驗設計", type: "Website", score: 91, grade: "A", date: "2024-01-05", status: "completed", }, ] export default function HistoryPage() { const [searchTerm, setSearchTerm] = useState("") const [filterType, setFilterType] = useState("all") const [filterStatus, setFilterStatus] = useState("all") const filteredHistory = mockHistory.filter((item) => { const matchesSearch = item.title.toLowerCase().includes(searchTerm.toLowerCase()) const matchesType = filterType === "all" || item.type === filterType const matchesStatus = filterStatus === "all" || item.status === filterStatus return matchesSearch && matchesType && matchesStatus }) const getGradeColor = (grade: string) => { if (grade.startsWith("A")) return "bg-green-100 text-green-800" if (grade.startsWith("B")) return "bg-blue-100 text-blue-800" if (grade.startsWith("C")) return "bg-yellow-100 text-yellow-800" return "bg-gray-100 text-gray-800" } const getTypeIcon = (type: string) => { switch (type) { case "PPT": return case "Video": return case "Website": return default: return } } return (
{/* Header */}

歷史記錄

查看您的所有評審記錄和結果

{/* Filters */}
setSearchTerm(e.target.value)} className="pl-10" />
{/* Statistics */}
{mockHistory.length}
總評審數
{mockHistory.filter((item) => item.status === "completed").length}
已完成
{Math.round( mockHistory.filter((item) => item.score > 0).reduce((sum, item) => sum + item.score, 0) / mockHistory.filter((item) => item.score > 0).length, )}
平均分數
{mockHistory.filter((item) => item.status === "processing").length}
處理中
{/* History List */}
{filteredHistory.map((item) => (
{getTypeIcon(item.type)}

{item.title}

{item.date}
{item.type} {item.status === "completed" ? "已完成" : "處理中"}
{item.status === "completed" && (
{item.score}
{item.grade}
)}
{item.status === "completed" ? ( <> ) : ( )}
))}
{filteredHistory.length === 0 && (

沒有找到相關記錄

嘗試調整搜尋條件或篩選器

)}
) }