22
33import { GameView } from "@/components/GameView" ;
44import { ParticipantList } from "@/components/ParticipantList" ;
5+ import { RoomInfo } from "@/components/RoomInfo" ;
56import { UsernameInput } from "@/components/UsernameInput" ;
67import {
78 ConnectionDetails ,
89 ConnectionDetailsBody ,
910} from "@/pages/api/connection_details" ;
1011import { LiveKitRoom } from "@livekit/components-react" ;
11- import { useCallback , useState } from "react" ;
12+ import { useCallback , useMemo , useState } from "react" ;
13+ import { toast } from "react-hot-toast" ;
1214
1315type Props = {
1416 params : { room_name : string } ;
@@ -18,6 +20,10 @@ export default function Page({ params: { room_name } }: Props) {
1820 const [ connectionDetails , setConnectionDetails ] =
1921 useState < ConnectionDetails | null > ( null ) ;
2022
23+ const humanRoomName = useMemo ( ( ) => {
24+ return decodeURI ( room_name ) ;
25+ } , [ room_name ] ) ;
26+
2127 const requestConnectionDetails = useCallback (
2228 async ( username : string ) => {
2329 const body : ConnectionDetailsBody = { room_name, username } ;
@@ -38,8 +44,10 @@ export default function Page({ params: { room_name } }: Props) {
3844 // If we don't have any connection details yet, show the username form
3945 if ( connectionDetails === null ) {
4046 return (
41- < div >
42- < h2 > { room_name } </ h2 >
47+ < div className = "w-screen h-screen flex flex-col items-center justify-center" >
48+ < h2 className = "text-4xl mb-4" > { humanRoomName } </ h2 >
49+ < RoomInfo roomName = { room_name } />
50+ < div className = "divider" > </ div >
4351 < UsernameInput
4452 submitText = "Join Room"
4553 onSubmit = { async ( username ) => {
0 commit comments