import React, { useState } from 'react'; import { ChevronDown, ChevronRight, User, X } from 'lucide-react'; /** * Replaces LLMChats3's LLMSelector. Lists the user's currently selected * participants with: * - Toggle slider (on/off, doesn't deselect) * - Accordion showing the LLM and the persona prompt * - "Remove" button when the participant is off (does deselect) */ export default function ParticipantSidebar({ participants, enabledMap, modelAssignments, neonPromptByModelId = {}, onToggleEnabled, onRemove, autoSelectMode, maxParticipants, }) { // In auto-select mode with no chat in progress, the sidebar shows a // placeholder explaining the deferred selection. Once the chat // starts, App.js populates `participants` with the LLM-chosen set // and the regular cards render normally. const showAutoPlaceholder = autoSelectMode && participants.length === 0; return ( ); } function ParticipantCard({ participant, enabled, modelOverride, neonPromptByModelId, onToggleEnabled, onRemove }) { const [open, setOpen] = useState(false); const [promptExpanded, setPromptExpanded] = useState(false); const isHuman = participant.kind === 'human'; const effectiveModelId = modelOverride || participant.default_model_id || (participant.kind === 'neon' ? participant.participant_id : ''); const personaPrompt = (effectiveModelId.startsWith('neon:') && neonPromptByModelId[effectiveModelId]) || participant.role_prompt || ''; const PROMPT_PREVIEW_CHARS = 280; const promptIsLong = personaPrompt.length > PROMPT_PREVIEW_CHARS; const handleToggleOpen = () => { setOpen((wasOpen) => { if (wasOpen) setPromptExpanded(false); return !wasOpen; }); }; return (
{isHuman && ( )} {participant.name} {isHuman && ( Human )}
{enabled ? ( ) : ( )}
{!enabled && (
)} {open && (
{isHuman ? (
Role
In-the-loop human participant. The orchestrator pauses for your input when it's your turn. Edit your name and credential summary from the "Human: …" button in the header.
) : ( <>
LLM
{modelOverride || participant.default_model_id || participant.model_display || ''}
Persona prompt
                  {personaPrompt || '(no prompt set)'}
                
{promptIsLong && ( )}
)}
)}
); }