// In this file, all Page components from 'src/pages` are auto-imported. Nested
// directories are supported, and should be uppercase. Each subdirectory will be
// prepended onto the component name.
//
// Examples:
//
// 'src/pages/HomePage/HomePage.js'         -> HomePage
// 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage

import { Set, Router, Route, PrivateSet } from '@redwoodjs/router'

import NavigationLayout from 'src/layouts/NavigationLayout'
import ScaffoldLayout from 'src/layouts/ScaffoldLayout'

import { useAuth } from './auth'

const Routes = () => {
  return (
    <Router useAuth={useAuth}>
      <PrivateSet wrap={NavigationLayout} unauthenticated="home">
        <Route path="/dashboard" page={DashboardPage} name="dashboard" />
        <PrivateSet unauthenticated="home" roles="admin">
          <Set wrap={ScaffoldLayout} title="Posts" titleTo="posts" buttonLabel="New Post" buttonTo="newPost">
            <Route path="/admin/posts/new" page={PostNewPostPage} name="newPost" />
            <Route path="/admin/posts/{id:Int}/edit" page={PostEditPostPage} name="editPost" />
            <Route path="/admin/posts/{id:Int}" page={PostPostPage} name="post" />
            <Route path="/admin/posts" page={PostPostsPage} name="posts" />
          </Set>
          <Set wrap={ScaffoldLayout} title="Nachhilfeangebote" titleTo="nachhilfeangebote" buttonLabel="New Nachhilfeangebot" buttonTo="newNachhilfeangebot">
            <Route path="/admin/nachhilfeangebote/new" page={NachhilfeangebotNewNachhilfeangebotPage} name="newNachhilfeangebot" />
            <Route path="/admin/nachhilfeangebote/{id:Int}/edit" page={NachhilfeangebotEditNachhilfeangebotPage} name="editNachhilfeangebot" />
            <Route path="/admin/nachhilfeangebote/{id:Int}" page={NachhilfeangebotNachhilfeangebotPage} name="nachhilfeangebot" />
            <Route path="/admin/nachhilfeangebote" page={NachhilfeangebotNachhilfeangebotsPage} name="nachhilfeangebote" />
          </Set>
        </PrivateSet>
      </PrivateSet>
      {/* <Route path="/login" page={LoginPage} name="login" /> */}
      {/* <Route path="/signup" page={SignupPage} name="signup" /> */}
      {/* <Route path="/forgot-password" page={ForgotPasswordPage} name="forgotPassword" /> */}
      {/* <Route path="/reset-password" page={ResetPasswordPage} name="resetPassword" /> */}
      <Route path="/" page={HomePage} name="home" />
      <Route notfound page={NotFoundPage} />
    </Router>
  )
}

export default Routes
