import m from "mithril"
import { nav } from "./components/nav"
import { header } from "./components/header"
import { register, login, loginUser } from "./components/auth"
import { questionnaireList } from "./components/questionnaireList"
import { questionnaireList as clientQuestionnaireList } from "./components/client/questionnaireList"
import { questionnaire } from "./components/questionnaire"
import { questionnaire as clientQuestionnaire } from "./components/client/questionnaire"
import { editQuestionnaire } from "./components/editQuestionnaire"
import { section } from "./components/section"
import { editSection } from "./components/editSection"
import { question } from "./components/question"
import clientQuestion from "./components/client/question"
import { editQuestion } from "./components/editQuestion"
import signup from "./components/hello"
import {userList, userAll} from "./components/beta/userList"

m.route.prefix("#")
m.route(document.body, "/", {
    "/": header,
    "/auth": "/auth/register",
    "/auth/register": register,
    "/auth/login": login,
    "/login": loginUser,
    "/questionnaires": clientQuestionnaireList,
    "/questionnaires/:id": clientQuestionnaire,
    "/sections/:id": clientQuestion,
    "/questions/:id": clientQuestion,
    "/questions/:id/edit": editQuestion,
    "/user/questionnaires": questionnaireList,
    "/user/questionnaires/:id": questionnaire,
    "/user/questionnaires/:id/edit": editQuestionnaire,
    "/user/sections/:id": section,
    "/user/sections/:id/edit": editSection,
    "/user/questions/:id": question,
    "/user/questions/:id/edit": editQuestion,
    "/beta/departments/:id": userList,
    "/beta/users": userAll
})
