remnantchat/src/Bootstrap.tsx

27 lines
611 B
TypeScript
Raw Normal View History

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