'use client'; import { useState } from 'react'; import * as Accordion from '../Accordion'; import * as RadioGroup from '../RadioGroup'; import * as Switch from '../Switch'; import * as Slider from '../Slider'; import { ScenarioIcon } from '../Icons/ScenarioIcon'; import { AudioSpeakerIcon } from '../Icons/AudioSpeakerIcon'; import { MicrophoneIcon } from '../Icons/MicrophoneIcon'; import { RecordIcon } from '../Icons/RecordIcon'; import { TimerIcon } from '../Icons/TimerIcon'; import { AudienceIcon } from '../Icons/AudienceIcon'; import { studioControls } from 'styled-system/recipes'; import { Badge } from '../Badge'; import type { StudioControlsProps, RecordingMode } from './types'; // ── Static section data ──────────────────────────────────────────────────────── const SETTING_BADGES = [ { id: 'conversation-flow', label: 'Conversation Flow' }, { id: 'question-complexity', label: 'Question Complexity' }, { id: 'response-pacing', label: 'Response Pacing' }, { id: 'interview-tone', label: 'Interview Tone' }, ] as const; const RECORDING_OPTIONS = [ { value: 'no-recording', label: 'No Recording' }, { value: 'audio-only', label: 'Record just audio' }, { value: 'video-audio', label: 'Record video & audio' }, ] as const; const LEVEL_COLOR_PALETTE = { beginner: 'primary', intermediate: 'secondary', advanced: 'tertiary', } as const; const ALL_SECTION_IDS = [ 'scenario-settings', 'audio-output', 'mic-input', 'av-recording', 'display-timer', 'hide-interviewers', ]; // ── Component ───────────────────────────────────────────────────────────────── const DEFAULT_TRIGGER_CSS = { fontSize: 'sm', fontWeight: 'semibold', } as const; export function StudioControls({ scenarioName, scenarioFocus, scenarioLevel, defaultAudioLevel = 75, defaultMicLevel = 75, defaultRecordingMode = 'no-recording', defaultShowTimer = true, defaultHideInterviewers = false, triggerCss, onAudioLevelChange, onMicLevelChange, onRecordingModeChange, onTimerChange, onInterviewersChange, }: StudioControlsProps) { const resolvedTriggerCss = { ...DEFAULT_TRIGGER_CSS, ...triggerCss }; const styles = studioControls(); const [audioLevel, setAudioLevel] = useState(defaultAudioLevel); const [micLevel, setMicLevel] = useState(defaultMicLevel); const levelLabel = scenarioLevel.charAt(0).toUpperCase() + scenarioLevel.slice(1); return (
{scenarioName}
Focus: {scenarioFocus}
Scenario Settings
Hide timer to create more realistic interview
Switch off to hide video of interviewers if it is too distracting