import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ReloadHelperComponent } from '@app/ui/misc/reload-helper/reload-helper.component';
import { B2AccessLoginComponent } from './ui/auth/login/b2access/b2access-login.component';

const appRoutes: Routes = [
	{
		path: '',
		redirectTo: '/home',
		data: {
			breadcrumbs: false,
			title: 'GENERAL.TITLES.GENERAL'
		},
		pathMatch: 'full'
	},
	{
		path: 'datasetcreatewizard',
		loadChildren: () => import('./ui/dataset-create-wizard/dataset-create-wizard.module').then(m => m.DatasetCreateWizardModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASETCREATEWIZARD'
		}
	},
	{
		path: 'explore',
		loadChildren: () => import('./ui/explore-dataset/explore-dataset.module').then(m => m.ExploreDatasetModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.EXPLORE'
		}
	},
	{
		path: 'explore-plans',
		loadChildren: () => import('./ui/explore-dmp/explore-dmp.module').then(m => m.ExploreDmpModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.EXPLORE-PLANS'
		}
	},
	{
		path: 'datasets',
		loadChildren: () => import('./ui/dataset/dataset.module').then(m => m.DatasetModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASETS'
		}
	},
	{
		path: 'about',
		loadChildren: () => import('./ui/about/about.module').then(m => m.AboutModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.ABOUT'
		}
	},
	// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
	// {
	// 	path: 'grants',
	// 	loadChildren: () => import('./ui/grant/grant.module').then(m => m.GrantModule),
	// 	data: {
	// 		breadcrumb: true,
	// 		title: 'GENERAL.TITLES.GRANTS'
	// 	}
	// },
	{
		path: 'plans',
		loadChildren: () => import('./ui/dmp/dmp.module').then(m => m.DmpModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.PLANS'
		}
	},
	{
		path: 'dmp-profiles',
		loadChildren: () => import('./ui/admin/dmp-profile/dmp-profile.module').then(m => m.DmpProfileModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DMP-PROFILES'
		}
	},
	{
		path: 'quick-wizard',
		loadChildren: () => import('./ui/quick-wizard/quick-wizard.module').then(m => m.OuickWizardModule),
		data: {
			breadcrumb: true,
			title: "GENERAL.TITLES.QUICK-WIZARD"
		}
	},
	{
		path: 'dataset-profiles',
		loadChildren: () => import('./ui/admin/dataset-profile/dataset-profile.module').then(m => m.DatasetProfileModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASET-PROFILES'
		}
	},
	{
		path: 'contact-support',
		loadChildren: () => import('./ui/contact/contact.module').then(m => m.ContactModule),
		data: {
			breadcrumb: true,
			title: 'CONTACT.SUPPORT.TITLE'
		}
	},
	{
		path: 'glossary',
		loadChildren: () => import('./ui/glossary/glossary.module').then(m => m.GlossaryModule),
		data: {
			breadcrumb: true,
			title: 'GLOSSARY.TITLE'
		}
	},
	{
		path: 'faq',
		loadChildren: () => import('./ui/faq/faq.module').then(m => m.FaqModule),
		data: {
			breadcrumb: true,
			title: 'FAQ.TITLE'
		}
	},
	{
		path: 'privacy-policy',
		loadChildren: () => import('./ui/sidebar/sidebar-footer/privacy/privacy.module').then(m => m.PrivacyModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.PRIVACY'
		}
	},
	{
		path: 'terms-of-service',
		loadChildren: () => import('./ui/sidebar/sidebar-footer/terms/terms.module').then(m => m.TermsModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.TERMS'
		}
	},
	{
		path: 'home',
		loadChildren: () => import('./ui/dashboard/dashboard.module').then(m => m.DashboardModule),
		data: {
			breadcrumb: true
		}
	},
	{
		path: 'unauthorized',
		loadChildren: () => import('./ui/misc/unauthorized/unauthorized.module').then(m => m.UnauthorizedModule),
		data: {
			breadcrumb: true
		},
	},
	{
		path: 'users',
		loadChildren: () => import('./ui/admin/user/user.module').then(m => m.UserModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.USERS'
		},
	},
	{
		path: 'profile',
		loadChildren: () => import('./ui/user-profile/user-profile.module').then(m => m.UserProfileModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.PROFILE'
		},
	},
	{
		path: 'language-editor',
		loadChildren: () => import('./ui/language-editor/language-editor.module').then(m => m.LanguageEditorModule),
		data: {
			breadcrumb: true,
			title: 'Language Editor'
		},
	},
	{
		path: 'login/admin',
		loadChildren: () => import('./ui/auth/admin-login/admin-login.module').then(m => m.AdminLoginModule),
		data: {
			breadcrumb: true
		},
	},
	{
		path: 'login',
		loadChildren: () => import('./ui/auth/login/login.module').then(m => m.LoginModule),
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.LOGIN'
		},
	},
	{
		path: 'api/oauth/authorized/b2access',
		component: B2AccessLoginComponent,
		data: {
		},
	},
	{ path: 'reload', component: ReloadHelperComponent }
];

@NgModule({
	imports: [RouterModule.forRoot(appRoutes)],
	exports: [RouterModule],
})
export class AppRoutingModule { }

