import { Route, Routes } from "react-router-dom";
import TopPage from "pages/TopPage";
import LoginPage from "pages/LoginPage";
import SamplePage from "pages/SamplePage";
import { AuthErrorPage } from "pages/ErrorPage";
import { NotFoundPage } from "pages/ErrorPage/notFound";
import { RouteAuthGuard } from "components/auth/routeAuthGuard";
import SignupPage from "pages/SignupPage";
import VerifyPage from "pages/VerifyPage";
import UserVerifyPage from "pages/UserVerifyPage";
import VerifySuccessPage from "pages/VerifySuccessPage";
import VerifyFailedPage from "pages/VerifyFailedPage";
import VerifyAlreadyExistPage from "pages/VerifyAlreadyExistPage";
import SignupCompletePage from "pages/SignupCompletePage";
import UserListPage from "pages/UserListPage";
import LicensePage from "pages/LicensePage";
import DictationPage from "pages/DictationPage";
import PartnerPage from "pages/PartnerPage";

const AppRouter: React.FC = () => (
  <Routes>
    <Route path="/" element={<TopPage />} />
    <Route path="/login" element={<LoginPage />} />
    <Route path="/authError" element={<AuthErrorPage />} />
    <Route
      path="/signup"
      element={<SignupPage completeTo="/signup/complete" />}
    />
    <Route path="/signup/complete" element={<SignupCompletePage />} />
    <Route path="/mail-confirm/" element={<VerifyPage />} />
    <Route path="/mail-confirm/user" element={<UserVerifyPage />} />
    <Route path="/mail-confirm/success" element={<VerifySuccessPage />} />
    <Route path="/mail-confirm/failed" element={<VerifyFailedPage />} />
    <Route
      path="/mail-confirm/alreadyExist"
      element={<VerifyAlreadyExistPage />}
    />
    <Route
      path="/user"
      element={<RouteAuthGuard component={<UserListPage />} />}
    />
    <Route
      path="/license"
      element={<RouteAuthGuard component={<LicensePage />} />}
    />
    <Route
      path="/xxx"
      element={<RouteAuthGuard component={<SamplePage />} />}
    />
    {/* XXX ヘッダーの挙動確認のため仮のページを作成 */}
    <Route
      path="/account"
      element={<RouteAuthGuard component={<SamplePage />} />}
    />
    <Route
      path="/dictations"
      element={<RouteAuthGuard component={<DictationPage />} />}
    />
    <Route
      path="/workflow"
      element={<RouteAuthGuard component={<SamplePage />} />}
    />
    <Route
      path="/partners"
      element={<RouteAuthGuard component={<PartnerPage />} />}
    />
    <Route path="*" element={<NotFoundPage />} />
  </Routes>
);

export default AppRouter;
