All files / web/src/app/arcade layout.tsx

0% Statements 0/21
0% Branches 0/1
0% Functions 0/1
0% Lines 0/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                           
'use client'

import dynamic from 'next/dynamic'

// Dynamic import breaks webpack's import chain, preventing useRoomData
// from being bundled with useUserPlayers in shared chunks
const GameModeProviderWithHooks = dynamic(
  () => import('@/contexts/GameModeProviderWithHooks').then((m) => m.GameModeProviderWithHooks),
  { ssr: false }
)

/**
 * Arcade Layout - wrapper for arcade game pages
 *
 * Uses GameModeProviderWithHooks which imports the player/room hooks.
 * This keeps those heavy imports out of GameModeContext.tsx, allowing
 * practice pages (which don't use this layout) to avoid loading them.
 */
export default function ArcadeLayout({ children }: { children: React.ReactNode }) {
  return <GameModeProviderWithHooks>{children}</GameModeProviderWithHooks>
}