import { Route, Routes } from "react-router-dom";
import { ClientAuthGate } from "./components/ClientAuthGate";
import { ClientLayout } from "./components/ClientLayout";
import { ClientMagicLinkExchangePage } from "./pages/ClientMagicLinkExchangePage";
import { ClientTabloListPage } from "./pages/ClientTabloListPage";
import { ClientTabloPage } from "./pages/ClientTabloPage";
import { LoginPage } from "./pages/LoginPage";

export default function AppRoutes() {
  return (
    <Routes>
      <Route path="/auth/exchange" element={<ClientMagicLinkExchangePage />} />
      <Route path="/login" element={<LoginPage />} />
      <Route element={<ClientAuthGate />}>
        <Route element={<ClientLayout />}>
          <Route path="/tablo/:tabloId" element={<ClientTabloPage />} />
          <Route path="/" element={<ClientTabloListPage />} />
        </Route>
      </Route>
    </Routes>
  );
}
