chat on spectator page

This commit is contained in:
legop3
2026-01-26 14:10:13 -05:00
parent 2062b4888c
commit b275d5a08c
5 changed files with 19 additions and 14 deletions
+7 -2
View File
@@ -8,7 +8,12 @@ import ChatTypingRow from './ChatTypingRow.jsx';
const FLITE_VOICES = ['kal', 'rms', 'slt', 'ksp', 'bdl'];
const ESPEAK_PITCHES = Array.from({ length: 10 }, (_, idx) => idx * 10);
export default function ChatPanel({ hideInput = false, hideSpectatorNotice = false, fillHeight = false }) {
export default function ChatPanel({
hideInput = false,
hideSpectatorNotice = false,
fillHeight = false,
allowSpectatorInput = false,
}) {
const { session } = useSession();
const {
messages,
@@ -30,7 +35,7 @@ export default function ChatPanel({ hideInput = false, hideSpectatorNotice = fal
const [engine, setEngine] = useState(() => ttsSettings?.engine || 'flite');
const [voice, setVoice] = useState(() => ttsSettings?.voice || 'rms');
const [pitch, setPitch] = useState(() => (Number.isFinite(ttsSettings?.pitch) ? ttsSettings.pitch : 50));
const canChat = session?.role !== 'spectator';
const canChat = session?.role !== 'spectator' || allowSpectatorInput;
const listRef = useRef(null);
const currentRoverId = session?.assignment?.roverId || null;