import { Route, Routes } from "react-router-dom";
import TopPage from "pages/TopPage";
import AuthPage from "pages/AuthPage";
import LoginPage from "pages/LoginPage";
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";
import WorkflowPage from "pages/WorkflowPage";
import TypistGroupSettingPage from "pages/TypistGroupSettingPage";
import WorktypeIdSettingPage from "pages/WorkTypeIdSettingPage";
import AccountPage from "pages/AccountPage";
import AcceptToUsePage from "pages/TermsPage";
import { TemplateFilePage } from "pages/TemplateFilePage";
import { AccountDeleteSuccess } from "pages/AccountPage/accountDeleteSuccess";
import SupportPage from "pages/SupportPage";

const AppRouter: React.FC = () => (
  <Routes>
    <Route path="/" element={<TopPage />} />
    <Route path="/auth" element={<AuthPage />} />
    <Route path="/login" element={<LoginPage />} />
    <Route path="/authError" element={<AuthErrorPage />} />
    <Route
      path="/signup"
      element={<SignupPage completeTo="/signup/complete" />}
    />
    <Route path="/terms" element={<AcceptToUsePage />} />
    <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="/account"
      element={<RouteAuthGuard component={<AccountPage />} />}
    />
    <Route
      path="/dictations"
      element={<RouteAuthGuard component={<DictationPage />} />}
    />
    <Route
      path="/workflow"
      element={<RouteAuthGuard component={<WorkflowPage />} />}
    />
    <Route
      path="/workflow/typist-group"
      element={<RouteAuthGuard component={<TypistGroupSettingPage />} />}
    />
    <Route
      path="/workflow/worktype-id"
      element={<RouteAuthGuard component={<WorktypeIdSettingPage />} />}
    />
    <Route
      path="/workflow/template"
      element={<RouteAuthGuard component={<TemplateFilePage />} />}
    />
    <Route
      path="/partners"
      element={<RouteAuthGuard component={<PartnerPage />} />}
    />
    <Route path="/accountDeleteSuccess" element={<AccountDeleteSuccess />} />
    <Route
      path="/support"
      element={<RouteAuthGuard component={<SupportPage />} />}
    />

    <Route path="*" element={<NotFoundPage />} />
  </Routes>
);

export default AppRouter;
