remnantchat/src/Bootstrap.tsx

27 lines
611 B
TypeScript
Raw Normal View History

2022-08-20 19:20:51 +00:00
import { useState } from 'react'
2022-08-10 02:28:46 +00:00
import { Routes, Route } from 'react-router-dom'
2022-08-20 19:20:51 +00:00
import { v4 as uuid } from 'uuid'
2022-08-10 02:28:46 +00:00
import { Home } from './pages/Home/'
2022-08-10 03:14:59 +00:00
import { PublicRoom } from './pages/PublicRoom/'
2022-08-09 14:35:49 +00:00
function Bootstrap() {
2022-08-20 19:20:51 +00:00
const [userId] = useState(uuid())
2022-08-10 02:28:46 +00:00
return (
<div className="Chitchatter">
<Routes>
2022-08-11 03:31:11 +00:00
{['/', '/index.html'].map(path => (
<Route key={path} path={path} element={<Home />} />
))}
2022-08-20 19:20:51 +00:00
<Route
path="/public/:roomId"
element={<PublicRoom userId={userId} />}
/>
2022-08-10 02:28:46 +00:00
</Routes>
</div>
)
2022-08-09 14:35:49 +00:00
}
export default Bootstrap