File size: 911 Bytes
9646e24
 
 
 
3f13033
 
 
9646e24
 
 
 
55a1282
9646e24
 
 
 
 
 
 
3f13033
 
 
 
 
 
 
 
 
 
9646e24
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use client";

import { usePathname } from "next/navigation";
import { GameNav } from "@/components/GameNav";
import { CommandPalette } from "@/components/CommandPalette";
import { VoiceOrb } from "@/components/VoiceOrb";
import { VoiceProvider } from "@/components/VoiceContext";

const BARE_ROUTES = ["/login", "/auth"];

export function AppShell({ children }: { children: React.ReactNode }) {
  const pathname = usePathname() ?? "";
  const isBare = BARE_ROUTES.some((r) => pathname === r || pathname.startsWith(r + "/"));

  if (isBare) {
    return <>{children}</>;
  }

  return (
    <VoiceProvider>
      <div className="relative min-h-screen bg-background">
        <GameNav />
        <main className="relative z-10 mx-auto max-w-7xl px-4 pb-16 pt-6 sm:px-6" key={pathname}>
          {children}
        </main>
        <CommandPalette />
        <VoiceOrb />
      </div>
    </VoiceProvider>
  );
}