import React, { useState } from "react"; import { Stack, Box, Typography, TextField, ToggleButton, ToggleButtonGroup, alpha, IconButton, Tooltip } from "@mui/material"; import PersonIcon from "@mui/icons-material/Person"; import GroupIcon from "@mui/icons-material/Group"; import SettingsIcon from "@mui/icons-material/Settings"; import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; import HeadphonesIcon from "@mui/icons-material/Headphones"; import VideocamIcon from "@mui/icons-material/Videocam"; import { PodcastMode } from "../types"; import { PodcastModeInfoModal } from "./PodcastModeInfoModal"; interface PodcastConfigurationProps { duration: number; setDuration: (value: number) => void; speakers: number; setSpeakers: (value: number) => void; podcastMode: PodcastMode; setPodcastMode: (mode: PodcastMode) => void; } export const PodcastConfiguration: React.FC = ({ duration, setDuration, speakers, setSpeakers, podcastMode, setPodcastMode, }) => { const [modeInfoOpen, setModeInfoOpen] = useState(false); const handleDurationChange = (value: number) => { const clamped = Math.min(10, Math.max(1, value)); setDuration(clamped); }; const handleSpeakersChange = ( event: React.MouseEvent, newValue: number | null ) => { if (newValue !== null) { setSpeakers(newValue); } }; const handleModeChange = ( event: React.MouseEvent, newValue: PodcastMode | null ) => { if (newValue !== null) { setPodcastMode(newValue); } }; const podcastModes: { value: PodcastMode; label: string; icon: React.ReactNode; color: string; desc: string }[] = [ { value: "audio_only", label: "Audio", icon: , color: "#10b981", desc: "Audio podcast only" }, { value: "video_only", label: "Video", icon: , color: "#f97316", desc: "AI avatar video" }, { value: "audio_video", label: "Both", icon: <>, color: "#8b5cf6", desc: "Audio + Video" }, ]; return ( {/* Header with gradient background */} 2 Basic Configuration Set duration, speakers, and podcast mode {/* Podcast Mode */} Podcast Mode setModeInfoOpen(true)} sx={{ color: "#94a3b8", p: 0.25, "&:hover": { color: "#667eea" } }}> {podcastModes.map((mode) => ( {mode.icon} {mode.label} ))} m.value === podcastMode)?.color || "#64748b", fontSize: "0.75rem", fontWeight: 500 }}> {podcastModes.find(m => m.value === podcastMode)?.desc} {podcastMode === "audio_only" && " • No avatar needed • Lowest cost"} {podcastMode === "video_only" && " • Requires avatar • Medium cost"} {podcastMode === "audio_video" && " • Both formats • Highest cost"} {/* Duration Input */} Duration (minutes) handleDurationChange(Number(e.target.value) || 1)} InputProps={{ inputProps: { min: 1, max: 10 } }} size="small" helperText={duration > 10 ? "Maximum duration is 10 minutes" : "Recommended: 1-3 mins"} error={duration > 10} fullWidth sx={{ "& .MuiOutlinedInput-root": { backgroundColor: "#f8fafc", border: "2px solid rgba(102, 126, 234, 0.2)", borderRadius: 2, transition: "all 0.2s", "&:hover": { borderColor: "rgba(102, 126, 234, 0.4)", boxShadow: "0 2px 8px rgba(102, 126, 234, 0.1)", }, "&.Mui-focused": { borderColor: "#667eea", boxShadow: "0 0 0 4px rgba(102, 126, 234, 0.1)", backgroundColor: "#ffffff", }, }, "& .MuiOutlinedInput-input": { color: "#1e293b", fontWeight: 600, fontSize: "1rem", }, "& .MuiFormHelperText-root": { color: duration > 10 ? "#dc2626" : "#64748b", fontSize: "0.75rem", mt: 1, fontWeight: 500, }, }} /> {/* Speakers Toggle */} Number of Speakers 1 Speaker 2 Speakers {speakers === 1 ? "Single host format" : "Host and guest conversation"} setModeInfoOpen(false)} /> ); };