import React from 'react'; import type { CompetitorCandidate } from '../types'; import EvidencePopover from './EvidencePopover'; import { EditableCard } from './EditableCard'; interface Step3CompetitorsProps { candidates: CompetitorCandidate[]; onCandidatesChange: (candidates: CompetitorCandidate[]) => void; maxCompetitors: number; t: any; } const Step3Competitors: React.FC = ({ candidates, onCandidatesChange, maxCompetitors, t }) => { const sortedCandidates = [...candidates].sort((a, b) => b.confidence - a.confidence); return (

{t.title}

{t.subtitle(maxCompetitors)}

title={t.cardTitle} items={sortedCandidates} onItemsChange={onCandidatesChange} fieldConfigs={[ { key: 'name', label: t.nameLabel, type: 'text' }, { key: 'url', label: 'URL', type: 'text' }, { key: 'why', label: t.whyLabel, type: 'textarea' }, ]} newItemTemplate={{ name: '', url: '', confidence: 0.8, why: '', evidence: [] }} renderDisplay={(item, index) => (
{item.name} {t.visitButton}
{(item.confidence * 100).toFixed(0)}%

{item.why}

{index === maxCompetitors - 1 &&
{t.shortlistBoundary}
}
)} t={t.editableCard} />
); }; export default Step3Competitors;