blob: 7478876a59710c506ce19a9619eb5825bf5d1ee6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
import { useState } from 'react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import './Stage1.css';
export default function Stage1({ responses }) {
const [activeTab, setActiveTab] = useState(0);
if (!responses || responses.length === 0) {
return null;
}
return (
<div className="stage stage1">
<h3 className="stage-title">Stage 1: Individual Responses</h3>
<div className="tabs">
{responses.map((resp, index) => (
<button
key={index}
className={`tab ${activeTab === index ? 'active' : ''}`}
onClick={() => setActiveTab(index)}
>
{resp.model.split('/')[1] || resp.model}
</button>
))}
</div>
<div className="tab-content">
<div className="model-name">{responses[activeTab].model}</div>
<div className="response-text markdown-content">
<ReactMarkdown remarkPlugins={[remarkGfm]}>{responses[activeTab].response}</ReactMarkdown>
</div>
</div>
</div>
);
}
|