function LeadOpsQueuePanel({ jobs = [], stats = {}, onTick, onCancel, onRetry }) {
  return (
    <section className="free-seo-card">
      <h2>Background Queue</h2>
      <p>Queued lead discovery and competitor opportunity jobs.</p>
      <div className="score-grid">
        <div><strong>{stats.total || 0}</strong><span>Total jobs</span></div>
        <div><strong>{(stats.byStatus && stats.byStatus.queued) || 0}</strong><span>Queued</span></div>
        <div><strong>{(stats.byStatus && stats.byStatus.completed) || 0}</strong><span>Completed</span></div>
      </div>
      <button onClick={onTick}>Run one queued job</button>
      <table className="free-seo-table"><thead><tr><th>Title</th><th>Type</th><th>Status</th><th>Attempts</th><th>Actions</th></tr></thead><tbody>
        {jobs.map(job => <tr key={job.id}><td>{job.title}</td><td>{job.type}</td><td>{job.status}</td><td>{job.attempts || 0}</td><td><button onClick={() => onCancel(job.id)}>Cancel</button><button onClick={() => onRetry(job.id)}>Retry</button></td></tr>)}
      </tbody></table>
    </section>
  );
}
window.LeadOpsQueuePanel = LeadOpsQueuePanel;
