// Spectator Content // Purpose: Defines the Spectator Content module and the local helpers/components used in this file. // Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit. import { useSession, useSessionActions, useSessionSelector } from '../../context/SessionContext.jsx'; import { useSpectatorMode } from '../../hooks/useSpectatorMode.js'; import useDefaultNickname from '../../hooks/useDefaultNickname.js'; import useUserIdentitySync from '../../hooks/useUserIdentitySync.js'; import ChatPanel from '../../components/ChatPanel/index.jsx'; import AlertFeed from '../../components/AlertFeed/index.jsx'; import GlobalObjectiveBanner from '../../components/GlobalObjectiveBanner/index.jsx'; import RoverQueuesPanel from '../../components/RoverQueuesPanel/index.jsx'; import RawUserPilePanel from '../../components/RawUserPilePanel/index.jsx'; import ButtonBoxPanel from '../../components/ButtonBoxPanel/index.jsx'; import RewardRunOverlay from '../../components/RewardRunOverlay/index.jsx'; import ReplayReadyPopup from '../../components/ReplaySourcesPanel/ReplayReadyPopup.jsx'; import usePortraitLayout from './hooks/usePortraitLayout.js'; import RoverRow from './components/RoverRow.jsx'; import SecondaryRow from './components/SecondaryRow.jsx'; import LogsRow from './components/LogsRow.jsx'; export default function SpectatorContent() { const { session } = useSession(); const latestReplay = useSessionSelector((state) => state.latestReplay); const { clearLatestReplay } = useSessionActions(); const inLockdown = session?.mode === 'lockdown'; useDefaultNickname(); // The spectator route is not rendered through App.jsx, so it must opt into // the same persisted identity heartbeat here. That keeps the existing // cookie-backed identity and saved nickname behavior active without adding a // separate spectator identity path. useUserIdentitySync(); useSpectatorMode(); const isPortraitLayout = usePortraitLayout(); const roster = session?.roster ?? []; if (inLockdown) { return (
Spectate disabled during lockdown.
Please wait until the server leaves lockdown to view streams.