import { createRoot } from 'react-dom/client'
import { BrowserRouter, Routes, Route } from 'react-router-dom'
import './index.css'

import Home from './pages/Home'
import ChannelPage from './pages/ChannelPage'
import UserPage from './pages/UserPage'
import Login from './pages/Login'
import Register from './pages/Register'
import CreateChannel from './pages/CreateChannel'
import ChannelsPage from './pages/ChannelsPage'

createRoot(document.getElementById('root')!).render(
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<Home />} />
      <Route path="/c/:name" element={<ChannelPage />} />
      <Route path="/u/:username" element={<UserPage />} />
      <Route path="/login" element={<Login />} />
      <Route path="/register" element={<Register />} />
      <Route path="/create-channel" element={<CreateChannel />} />
      <Route path="/channels" element={<ChannelsPage />} />
    </Routes>
  </BrowserRouter>
)
