// Phase 4 Read Page Aloud: tracks which SpeakerButton instance is
// currently driving TTS. Only one speaker is active at a time — when
// a second button starts speech, the first reverts its icon via the
// `$derived` subscription in SpeakerButton.

export const activeSpeaker = $state<{ id: string | null }>({ id: null });

export function setActiveSpeaker(id: string | null): void {
  activeSpeaker.id = id;
}
