17 lines
306 B
TypeScript
17 lines
306 B
TypeScript
import { v4 } from "uuid";
|
|
import Room from "./Room";
|
|
|
|
export default function App() {
|
|
const x = new URL(window.location.href);
|
|
const roomId = x.pathname.replace(/^\//, "");
|
|
|
|
if (!roomId) {
|
|
location.href = `/${v4()}`;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
Hellosu, <Room roomId={roomId} />
|
|
</>
|
|
);
|
|
}
|