import StructuredDataList from "./../modules/StructuredData/StructuredDataList";
import CategoriesList from "./../modules/Categories/CategoriesList";
import Sites from "./../modules/Sites";
import StructuredData from "./../modules/StructuredData";
import Users from "./../modules/Users";
import Profile from "../modules/Users/Profile";
import UserCreate from "../modules/Users/UserCreate";
import UserEdit from "../modules/Users/UserEdit";
import Editor from "./../modules/GlobalEditor";
import GlobalSettings from "./../modules/GlobalSettings";
import AnalyticsSettings from "../modules/Analytics";
import FramePreview from "../modules/FramePreview";
import FileDrive from "../modules/FileDrive";
import FormList from "../modules/Forms/FormList";
import FormEditor from "../modules/Forms/FormEditor";
import FormCategoriesList from "../modules/Forms/FormCategoriesList";
import MediaGallery from "../modules/MediaGallery";
import ActivityLog from "../modules/ActivityLog";

export default [
	{
		path: "/sites",
		component: Sites,
		name: "Sites",
		showInNav: true,
		icon: "Project",
		permission: "",
	},
	{
		path: "/data",
		component: StructuredDataList,
		name: "Global Content",
		showInNav: true,
		icon: "Data",
		permission: "global.globalData.accessToGlobalData",
	},
	{
		path: `/data/pages/editor`,
		component: Editor,
		name: "Page Editor",
		showInNav: false,
		hideNav: true,
		permission: "global.globalData.readGlobalData",
	},
	{
		path: `/data/pages/editor/new`,
		component: Editor,
		name: "New Page Editor",
		showInNav: false,
		hideNav: true,
		permission: "global.globalData.createAllGlobalData",
	},
	{
		path: "/data/:id/editor",
		component: StructuredData,
		showInNav: false,
		name: "New StructuredData",
		permission: "global.globalData.readGlobalData",
		hideNav: true,
	},
	{
		path: "/categories",
		component: CategoriesList,
		name: "Categories",
		showInNav: true,
		icon: "Category",
		permission: "global.globalData.accessToTaxonomies",
	},
	{
		path: "/forms",
		component: FormList,
		name: "Forms",
		showInNav: true,
		icon: "Form",
		permission: [
			"global.forms.createForms",
			"global.forms.editForms",
			"global.forms.deleteForms",
			"global.forms.publishUnpublishForms",
		],
	},
	{
		path: "/forms/categories",
		component: FormCategoriesList,
		name: "Form Categories",
		showInNav: false,
		permission: [
			"global.forms.createFormsCategories",
			"global.forms.editFormsCategories",
			"global.forms.deleteFormsCategories",
		],
	},
	{
		path: "/forms/categories/:cat",
		component: FormCategoriesList,
		name: "Form Categories",
		showInNav: false,
		permission: [
			"global.forms.createFormsCategories",
			"global.forms.editFormsCategories",
			"global.forms.deleteFormsCategories",
		],
	},
	{
		path: `/media-assets`,
		component: null,
		name: "Media Assets",
		showInNav: true,
		icon: "Photo-library",
		permission: ["global.mediaGallery.accessToGlobalFileDrive", "global.mediaGallery.accessToGlobalGallery"],
		routesGroups: [
			{
				name: "Media Assets",
				routes: [
					{
						path: "/media-assets/gallery",
						component: MediaGallery,
						name: "Media Gallery",
						permission: "global.mediaGallery.accessToGlobalGallery",
					},
					{
						path: "/media-assets/files",
						component: FileDrive,
						name: "File Drive Manager",
						permission: "global.mediaGallery.accessToGlobalFileDrive",
					},
				],
			},
		],
	},
	{
		path: "/users",
		component: Users,
		name: "Users",
		showInNav: true,
		icon: "Users",
		permission: "global.usersRoles.accessToUsersRoles",
	},
	{ path: "/profile", component: Profile, name: "Profile", showInNav: false, icon: "User" },
	{
		path: "/roles",
		component: Users,
		name: "Roles",
		showInNav: false,
		permission: "global.usersRoles.accessToUsersRoles",
	},
	{
		path: "/users/new",
		component: UserCreate,
		name: "New User",
		showInNav: false,
		permission: "global.usersRoles.createUsers",
	},
	{
		path: "/users/edit",
		component: UserEdit,
		name: "New User",
		showInNav: false,
		permission: "global.usersRoles.editUsers",
	},
	{
		path: `/settings`,
		component: null,
		name: "Settings",
		showInNav: true,
		icon: "Settings",
		permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
		routesGroups: [
			{
				name: "Settings",
				routes: [
					{
						path: `/settings/robots`,
						component: GlobalSettings,
						name: "SEO tools",
						permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
					},
					{
						path: `/settings/analytics`,
						component: AnalyticsSettings,
						name: "Analytics tools",
						permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
					},
				],
			},
		],
	},
	{
		path: `/settings/redirects`,
		component: GlobalSettings,
		name: "Settings",
		showInNav: false,
		permission: "global.seoAnalytics.editSeoAnalyticsInGlobalPages",
	},
	{
		path: `/editor/page-preview`,
		component: FramePreview,
		name: "Preview",
		showInNav: false,
		hideNav: true,
	},
	{
		path: `/forms/editor`,
		component: FormEditor,
		name: "Form Editor",
		showInNav: false,
		hideNav: true,
		permission: ["global.forms.createForms", "global.forms.editForms"],
	},
	{
		path: `/forms/editor/new`,
		component: FormEditor,
		name: "New Form Editor",
		showInNav: false,
		hideNav: true,
		permission: ["global.forms.createForms", "global.forms.editForms"],
	},
	{
		path: "/log",
		component: ActivityLog,
		name: "Log",
		showInNav: true,
		icon: "log",
		permission: "global.accessToActivityLog",
	},
];
