"use client" import { usePathname } from "next/navigation" import { useState, useCallback } from "react" import { SiteHeader } from "@/components/layout/site-header" import { SportsSidebar } from "@/components/layout/sports-sidebar" import { RightPanel } from "@/components/layout/right-panel" import { SiteFooter } from "@/components/layout/site-footer" import { AuthModal } from "@/components/layout/auth-modal" import { MobileBottomNav } from "@/components/layout/mobile-bottom-nav" import { cn } from "@/lib/utils" type AuthMode = "login" | "register" export default function LayoutClientWrapper({ children }: { children: React.ReactNode }) { const pathname = usePathname() const isLivePage = pathname === "/live" const isVirtualPage = pathname === "/virtual" const isSpecialGamesPage = pathname === "/special-games" const hideLeftSidebar = isLivePage || isVirtualPage || isSpecialGamesPage const hideRightSidebar = isVirtualPage || isSpecialGamesPage // Show RightPanel on Live page const [authOpen, setAuthOpen] = useState(false) const [authMode, setAuthMode] = useState("login") const openAuth = useCallback((mode: AuthMode) => { setAuthMode(mode) setAuthOpen(true) }, []) return (
openAuth("login")} onRegisterClick={() => openAuth("register")} />
{/* Sidebar: hidden on mobile and hidden on specific pages */} {!hideLeftSidebar && (
)}
{children}
{/* Right panel: completely off-flow on mobile/tablet; only from lg to match RightPanel */} {!hideRightSidebar && (
)}
{/* Mobile fixed bottom nav */} {/* Auth modal */} setAuthOpen(false)} />
) }