import Router from "preact-router";
import { settings } from "./globalSettings";

import { DeleteSecretsEngine } from "./ui/pages/Secrets/DeleteSecretsEngine";
import { Home } from "./ui/pages/Home";
import { KeyValueDelete } from "./ui/pages/Secrets/KeyValue/KeyValueDelete";
import { KeyValueView } from "./ui/pages/Secrets/KeyValue/KeyValueView";
import { KeyValueEdit } from "./ui/pages/Secrets/KeyValue/KeyValueEdit";
import { KeyValueList } from "./ui/pages/Secrets/KeyValue/KeyValueList";
import { Login } from "./ui/pages/Login";
import { Me } from "./ui/pages/Me";
import { NewKVEngine } from "./ui/pages/Secrets/NewEngines/NewKVEngine";
import { NewSecretsEngine } from "./ui/pages/Secrets/NewSecretsEngine";
import { NewTOTPEngine } from "./ui/pages/Secrets/NewEngines/NewTOTPEngine";
import { NewTransitEngine } from "./ui/pages/Secrets/NewEngines/NewTransitEngine";
import { TransitNew } from "./ui/pages/Secrets/Transit/TransitNew";
import { PasswordGenerator } from "./ui/pages/PwGen";
import { Secrets } from "./ui/pages/Secrets/SecretsHome";
import { SetLanguage } from "./ui/pages/SetLanguage";
import { SetVaultURL } from "./ui/pages/SetVaultURL";
import { TOTPDelete } from "./ui/pages/Secrets/TOTP/TOTPDelete";
import { TOTPNew } from "./ui/pages/Secrets/TOTP/TOTPNew";
import { TOTPList } from "./ui/pages/Secrets/TOTP/TOTPList";
import { TransitList } from "./ui/pages/Secrets/Transit/TransitList";
import { TransitView } from "./ui/pages/Secrets/Transit/TransitView";
import { Unseal } from "./ui/pages/Unseal";
import { KeyValueNew } from "./ui/pages/Secrets/KeyValue/KeyValueNew";
import { TransitDecrypt } from "./ui/pages/Secrets/Transit/TransitDecrypt";
import { TransitEncrypt } from "./ui/pages/Secrets/Transit/TransitEncrypt";
import { TransitRewrap } from "./ui/pages/Secrets/Transit/TransitRewrap";
import { PoliciesHome } from "./ui/pages/Policies/PoliciesHome";
import { PolicyView } from "./ui/pages/Policies/PolicyView";
import { PolicyNew } from "./ui/pages/Policies/PolicyNew";
import { PolicyDelete } from "./ui/pages/Policies/PolicyDelete";
import { PolicyEdit } from "./ui/pages/Policies/PolicyEdit";
import { AuthHome } from "./ui/pages/Access/Auth/AuthHome";
import { AccessHomePage } from "./ui/pages/Access/AccessHome";
import { AuthViewConfig } from "./ui/pages/Access/Auth/AuthViewConfig";
import { UserPassUsersList } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
import { UserPassUserDelete } from "./ui/pages/Access/Auth/userpass/UserPassUserDelete";
import { UserPassUserView } from "./ui/pages/Access/Auth/userpass/UserPassUserView";
import { UserPassUserNew } from "./ui/pages/Access/Auth/userpass/UserPassUserNew";
import { UserPassUserEdit } from "./ui/pages/Access/Auth/userpass/UserPassUserEdit";

export const Main = () => (
  <Router>
    <Home path="/" settings={settings} />
    <Me path="/me" settings={settings} />
    <Login path="/login" settings={settings} />
    <PasswordGenerator path="/pw_gen" />
    <SetVaultURL path="/set_vault_url" settings={settings} />
    <Unseal path="/unseal" settings={settings} />
    <SetLanguage path="/set_language" settings={settings} />

    <Secrets path="/secrets" settings={settings} />
    <DeleteSecretsEngine path="/secrets/delete_engine/:mount" settings={settings} />

    <NewSecretsEngine path="/secrets/new_secrets_engine" />
    <NewKVEngine path="/secrets/new_secrets_engine/kv" />
    <NewTOTPEngine path="/secrets/new_secrets_engine/totp" />
    <NewTransitEngine path="/secrets/new_secrets_engine/trasit" />

    <KeyValueNew path="/secrets/kv/new/:baseMount/:secretPath*?" settings={settings} />
    <KeyValueList path="/secrets/kv/list/:baseMount/:secretPath*?" settings={settings} />
    <KeyValueView path="/secrets/kv/view/:item/:baseMount/:secretPath*?" settings={settings} />
    <KeyValueEdit path="/secrets/kv/edit/:item/:baseMount/:secretPath*?" settings={settings} />
    <KeyValueDelete path="/secrets/kv/delete/:item/:baseMount/:secretPath*?" settings={settings} />

    <TOTPList path="/secrets/totp/list/:baseMount" settings={settings} />
    <TOTPNew path="/secrets/totp/new/:baseMount" settings={settings} />
    <TOTPDelete path="/secrets/totp/delete/:baseMount/:item" settings={settings} />

    <TransitNew path="/secrets/transit/new/:baseMount" settings={settings} />
    <TransitList path="/secrets/transit/list/:baseMount" settings={settings} />
    <TransitView path="/secrets/transit/view/:baseMount/:secretItem" settings={settings} />
    <TransitEncrypt path="/secrets/transit/encrypt/:baseMount/:secretItem" settings={settings} />
    <TransitDecrypt path="/secrets/transit/decrypt/:baseMount/:secretItem" settings={settings} />
    <TransitRewrap path="/secrets/transit/rewrap/:baseMount/:secretItem" settings={settings} />

    <PoliciesHome path="/policies" settings={settings} />
    <PolicyNew path="/policies/new" settings={settings} />
    <PolicyView path="/policies/view/:policyName" settings={settings} />
    <PolicyEdit path="/policies/edit/:policyName" settings={settings} />
    <PolicyDelete path="/policies/delete/:policyName" settings={settings} />

    <AccessHomePage path="/access" settings={settings} />
    <AuthHome path="/access/auth" settings={settings} />
    <AuthViewConfig path="/access/auth/view/:baseMount" settings={settings} />

    <UserPassUsersList path="/access/auth/userpass/list/:baseMount" settings={settings} />
    <UserPassUserNew path="/access/auth/userpass/new/:baseMount" settings={settings} />
    <UserPassUserView path="/access/auth/userpass/view/:baseMount/:user" settings={settings} />
    <UserPassUserEdit path="/access/auth/userpass/edit/:baseMount/:user" settings={settings} />
    <UserPassUserDelete path="/access/auth/userpass/delete/:baseMount/:user" settings={settings} />

    <div default>
      <p>PAGE NOT YET IMPLEMENTED</p>
    </div>
  </Router>
);
