"use client"; import ActionDrawer from '@/components/team/actionDrawer'; import Notification from '@/components/team/notification'; import PlacementOverlay from '@/components/team/placementOverlay'; import WaitingScreen from '@/components/team/waitingScreen'; import { LogoutButton } from '@/components/util/button'; import { useSocket } from '@/context/socketContext'; import { useTeamConnexion } from '@/context/teamConnexionContext'; import { useTeamContext } from '@/context/teamContext'; import useGame from '@/hook/useGame'; import { GameState } from '@/util/gameState'; import dynamic from 'next/dynamic'; import React from 'react' //Load the map without SSR const LiveMap = dynamic(() => import('@/components/team/map').then((mod) => mod.LiveMap), { ssr: false }); const PlacementMap = dynamic(() => import('@/components/team/map').then((mod) => mod.PlacementMap), { ssr: false }); export default function Track() { const { gameState, captured } = useGame(); const { gameSettings} = useTeamContext() const { useProtect } = useTeamConnexion(); const { teamSocket: socket } = useSocket(); useProtect(); return <> {gameState == GameState.SETUP && } {gameState == GameState.PLAYING && !captured &&
} {gameState == GameState.PLAYING && captured &&
Vous avez été capturé
{gameSettings?.capturedMessage}
} {gameState == GameState.PLACEMENT &&
} {gameState == GameState.FINISHED &&
Partie terminée
{captured &&
{gameSettings?.loserEndGameMessage}
} {!captured &&
{gameSettings?.winnerEndGameMessage}
}
} }