import { ArrowRightLeft, ChevronRight } from 'lucide-react'; import { motion } from 'motion/react'; import type { SchedulingSuggestion } from './types'; import Blur from '../../components/Blur'; interface Props { suggestions: SchedulingSuggestion[]; onSelect: (s: SchedulingSuggestion) => void; } function fmtKm(value: number): string { if (value >= 10000) return (value / 10000).toFixed(1) + '万'; return value.toLocaleString(); } function fmtRate(rate: number): string { return (rate * 100).toFixed(1) + '%'; } export default function SuggestionList({ suggestions, onSelect }: Props) { if (suggestions.length === 0) { return (

暂无调度建议

); } return (
调度干预清单 {suggestions.length}
{suggestions.map((s, idx) => { const isRescue = s.type === 'rescue_hopeless'; const v = s.currentVehicle; return ( onSelect(s)} > {/* Left: color bar */}
{/* Center: info */}
{v.plateNumber} {isRescue ? '无望' : '达标'} {v.vehicleType} · {v.region}
{v.customer || '-'} 日均 {Math.round(v.customerAvgDaily)} km 完成 = 1 ? 'text-emerald-600' : v.completionRate >= 0.5 ? 'text-amber-600' : 'text-rose-500'}`}>{fmtRate(v.completionRate)}
{/* Right: candidate count + arrow */}
{s.candidates.length}
); })}
); }