import { Check, CloudRain, Fish, Minus, Monitor, Moon, Mountain, Music, Palette, Plus, Settings, Sparkles, Loader2, Sun, Trash2, TreePine, Volume2, Wand2, Waves, } from 'lucide-react'; import type { LucideIcon } from 'lucide-react'; import { useState } from 'react'; import { toast } from 'sonner'; import type { ClassroomTimerActions, ClassroomTimerState } from '@/components/classroom-timer/types'; import type { SensoryBackgroundIconId } from '@/shared/types/classroomTimer'; import { TIMER_SOUND_GENERATED_MESSAGE } from '@/shared/constants/classroomTimer'; const BACKGROUND_ICONS: Record = { waves: Waves, sparkles: Sparkles, sun: Sun, moon: Moon, 'tree-pine': TreePine, 'cloud-rain': CloudRain, fish: Fish, mountain: Mountain, }; type TimerSettingsPanelProps = { state: ClassroomTimerState; actions: ClassroomTimerActions; }; export function TimerSettingsPanel({ state, actions }: TimerSettingsPanelProps) { const { customMinutes, customSeconds, selectedSound, selectedBackground, soundGroups, backgrounds, canManageAudio, isGeneratingSound, isDeletingSound, } = state; const [soundName, setSoundName] = useState(''); const handleGenerate = async () => { await actions.generateSound(soundName); setSoundName(''); toast.success(TIMER_SOUND_GENERATED_MESSAGE); }; return (

Custom Time

actions.parseCustomMinutes(event.target.value)} className="w-14 h-8 bg-slate-700/50 border border-slate-600/50 rounded-lg text-center text-white text-sm font-mono focus:ring-2 focus:ring-cyan-500/50 outline-none" />
:
actions.parseCustomSeconds(event.target.value)} className="w-14 h-8 bg-slate-700/50 border border-slate-600/50 rounded-lg text-center text-white text-sm font-mono focus:ring-2 focus:ring-cyan-500/50 outline-none" />

Timer Sound

{canManageAudio && (
setSoundName(event.target.value)} placeholder="Name your sound..." aria-label="Generated sound name" maxLength={80} className="flex-1 min-w-0 h-9 px-3 bg-slate-700/50 border border-slate-600/50 rounded-lg text-sm text-white placeholder-slate-500 focus:ring-2 focus:ring-violet-500/50 outline-none" />
)}
{soundGroups.map((group) => { if (group.sounds.length === 0) { return null; } return (

{group.label}

{group.sounds.map((sound) => { const isSelected = selectedSound?.key === sound.key; const deletableId = sound.canDelete ? sound.audioFileId : null; return (
{deletableId && ( )}
); })}
); })}

Sensory Background

{backgrounds.map((background) => { const BackgroundIcon = BACKGROUND_ICONS[background.iconId]; return ( ); })}
); }