import { Link } from 'react-router-dom' import { AlertCircle, Ban, Copy, ExternalLink, RefreshCw, Sparkles, Trash2, X } from 'lucide-react' import { imageURL } from '../../api/client' import type { ScrapeTask } from '../../types/scraper' import { formatTime, taskStatusMeta } from '../StrmManagePage' import { PROVIDER_LABELS, TYPE_LABELS } from './scrapeLabels' export function ScrapeDetailModal({ task, onClose, onRetry, onCancel, onDelete, onCopy, }: { task: ScrapeTask onClose: () => void onRetry: (t: ScrapeTask) => void onCancel: (t: ScrapeTask) => void onDelete: (t: ScrapeTask) => void onCopy: (text: string, label: string) => void }) { const status = taskStatusMeta(task.status) return (
e.stopPropagation()} >

刮削任务详情

{/* Matched Poster / Info Banner */} {task.matched_title ? (
{task.poster_url && ( )}
已匹配 {task.provider && ( {PROVIDER_LABELS[task.provider] ?? task.provider} )}

{task.matched_title}

{task.matched_year > 0 && 年份:{task.matched_year}} 类型:{TYPE_LABELS[task.media_type] ?? task.media_type}
{task.media_id && ( 在媒体详情中查看 )}
) : null} {/* Media Info Box */}
原始媒体标题 {task.media_title}
所属媒体库 {task.library_name}
媒体库类型 {TYPE_LABELS[task.media_type] ?? task.media_type}
当前状态 {task.status === 'done' ? '已匹配' : task.status === 'failed' ? '未匹配' : status.label}
剧照/海报刮削 {task.episode_images ? '开启' : '关闭'}
{/* File path */}
磁盘文件路径
{task.media_path}
{/* Error Message Box */} {task.error && (
刮削未匹配 / 异常详情
{task.error}
)} {/* Timeline */}
入队时间:{formatTime(task.created_at)}
{task.started_at &&
开始刮削:{formatTime(task.started_at)}
} {task.finished_at &&
完成时间:{formatTime(task.finished_at)}
}
{/* Footer Actions */}
{(task.status === 'done' || task.status === 'failed' || task.status === 'canceled') && ( )}
{(task.status === 'pending' || task.status === 'running') && ( )}
) }