import { Routes } from "@angular/router";

/* User Services Folder */
import { UserComponent } from "./user-services/user/user.component";
import { SignInComponent } from "./user-services/user/sign-in/sign-in.component";
import { SignUpComponent } from "./user-services/user/sign-up/sign-up.component";
import { AuthGuard } from "./user-services/auth/auth.guard";


/* Profile Folder */
import { UserProfileComponent } from "./profile/user-profile/user-profile.component";
import { EditProfileComponent } from "./profile/edit-profile/edit-profile.component";
import { HistoryComponent } from "./profile/history/history.component";
import { SavedArticlesComponent} from "./profile/saved-articles/saved-articles.component";


/* Displays Folder */
import { HomepageComponent } from "./displays/homepage/homepage.component";
import { DisplayresultsComponent } from "./displays/displayresults/displayresults.component";
import { DisplayArticleComponent } from "./displays/display-article/display-article.component";


/* Developer Folder */
import { DeveloperstatsComponent } from "./developer/developerstats/developerstats.component";
import { ClickHistoryComponent } from "./developer/click-history/click-history.component";
import { QueryInformationComponent } from  "./developer/query-information/query-information.component";
import { QueryHistoryComponent} from  "./developer/query-history/query-history.component";
import { ArticleInfoComponent } from "./developer/article-info/article-info.component";

export const appRoutes: Routes = [
  {
    path: "homepage",
    component: HomepageComponent
  },
  {
    path: "displayresults",
    component: DisplayresultsComponent
  },
  {
    path: "article",
    component: DisplayArticleComponent
  },
  {
    path: "signup",
    component: UserComponent,
    children: [
      {
        path: "",
        component: SignUpComponent
      }
    ]
  },
  {
    path: "userprofile",
    component: UserProfileComponent,
    canActivate: [AuthGuard]
  },
  {
    path: "savedarticles",
    component: SavedArticlesComponent
  },
  {
    path: "clickhistory",
    component: ClickHistoryComponent
  },
  {
  path: "history",
  component: HistoryComponent
  },
  {
    path: "editProfile",
    component: EditProfileComponent
    },
  {
    path: "developerstats",
    component: DeveloperstatsComponent
  },
  {
    path: "articleinfo",
    component: ArticleInfoComponent
  },
  {
    path: "queryinformation",
    component: QueryInformationComponent
  },
  {
    path: "queryhistory",
    component: QueryHistoryComponent
  },
  {
    path: "login",
    component: UserComponent,
    children: [
      {
        path: "",
        component: SignInComponent
      }
    ]
  },
  {
    /**
     * If a path is empty then it will default to 'homepage'
     */
    path: "",
    redirectTo: "homepage",
    pathMatch: "full"
  },
  {
    /**
     * If a path is entered to the url and it is not defined here
     * then it will default to 'homepage'
     */
    path: "**",
    redirectTo: "homepage"
  },

];
