import moduleBase from '@/pages/module/module-base';
import module from '@/pages/module/module';
import submissions from '@/pages/submissions';
import moduleVisibility from '@/pages/module/moduleVisibility';
import {
  MODULE_PAGE,
  MODULE_SETTINGS_PAGE,
  SNAPSHOT_DETAIL,
  SNAPSHOT_LIST,
  SUBMISSIONS_PAGE,
  VISIBILITY_PAGE,
} from '@/router/module.names';
import settingsPage from '@/pages/module/moduleSettings';
import snapshots from '@/pages/snapshot/snapshots';
import snapshot from '@/pages/snapshot/snapshot';
import {LAYOUT_SIMPLE} from '@/router/core.constants';

export default [
  {
    path: '/module/:slug',
    component: moduleBase,
    children: [
      {
        path: '',
        name: MODULE_PAGE,
        component: module,
        meta: {filter: true},
      },
      {
        path: 'submissions/:id',
        name: SUBMISSIONS_PAGE,
        component: submissions,
        meta: {
          filter: true,
          showSubNavigation: true,
        },
      },
      {
        path: 'settings',
        name: MODULE_SETTINGS_PAGE,
        component: settingsPage,
        meta: {
          showSubNavigation: true,
        },
      },
      {
        path: 'visibility',
        name: VISIBILITY_PAGE,
        component: moduleVisibility,
        meta: {
          layout: LAYOUT_SIMPLE,
          hideNavigation: true,
        },
      },
      {
        path: 'snapshots',
        component: snapshots,
        name: SNAPSHOT_LIST,
        meta: {
          showSubNavigation: true,
        },
      },
      {
        path: 'snapshot/:id',
        component: snapshot,
        name: SNAPSHOT_DETAIL,
        props: true,
        meta: {
          layout: LAYOUT_SIMPLE,
          hideNavigation: true,
          fullWidth: true
        },
      },
    ],
  },
];
