import { Feature, Scenario } from "../App"; import { generateFeatureFile } from "../utils/export"; import { downloadFile } from "../utils/download"; import { KEYWORDS } from "../utils/keywords"; interface BddCodePanelProps { feature: Feature | null; selectedScenario: Scenario | null; // Keep for potential future use (e.g., highlighting) } function BddCodePanel({ feature, selectedScenario: _selectedScenario }: BddCodePanelProps) { const generateBddCode = () => { if (!feature) { return ''; } // BUG FIX: Always generate the code for the entire feature, not just the selected scenario. return generateFeatureFile(feature.name, feature.scenarios, feature.language || 'es'); }; const code = generateBddCode(); const handleDownload = () => { if (feature && code) { downloadFile(`${feature.name}.feature`, code); } }; const handleCopy = () => { if (code) { navigator.clipboard.writeText(code).then(() => { alert('Copied to clipboard!'); }); } }; return (