d056647bbd
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
911 B
TypeScript
33 lines
911 B
TypeScript
import { createFileRoute } from "@tanstack/react-router"
|
|
import { useWebSocket } from "@/hooks/use-websocket"
|
|
import { useRoomStore } from "@/stores/room-store"
|
|
import { RoomLayout } from "@/components/room-layout"
|
|
import { BottomNav } from "@/components/bottom-nav"
|
|
|
|
export const Route = createFileRoute("/host/$roomCode")({
|
|
component: HostLayout,
|
|
})
|
|
|
|
function HostLayout() {
|
|
const { roomCode } = Route.useParams()
|
|
useWebSocket(roomCode)
|
|
const { room, connectionStatus } = useRoomStore()
|
|
|
|
if (!room) {
|
|
return (
|
|
<div className="flex min-h-screen items-center justify-center">
|
|
<p className="text-muted-foreground">
|
|
{connectionStatus === "connecting" ? "Connecting..." : "Room not found"}
|
|
</p>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<RoomLayout roomCode={roomCode} connectionStatus={connectionStatus} />
|
|
<BottomNav basePath="/host/$roomCode" roomCode={roomCode} isHost={true} />
|
|
</>
|
|
)
|
|
}
|