export default function RunHistoryList({ runs, loading, onSelect, selectedId }) {
  if (loading) return <section className="screener-card"><p>로딩…</p></section>;
  return (
    <section className="screener-card">
      <h3>최근 실행</h3>
      <ul style={{listStyle:'none', padding:0, margin:0, fontSize:13}}>
        {(runs || []).map((r) => (
          <li key={r.id} style={{padding:'6px 0', borderBottom:'1px solid #1f2937', cursor:'pointer',
                                  color: selectedId === r.id ? '#fbbf24' : '#e5e7eb'}}
              onClick={() => onSelect(r.id)}>
            {r.asof} · {r.mode}
          </li>
        ))}
      </ul>
    </section>
  );
}
