import { CREATE_TEAM, JOIN_TEAM, MY_TEAM, SHOW_SCHOOL_CLASS_CODE, SHOW_TEAM_CODE } from './me.names';
import { LAYOUT_SIMPLE } from '@/router/core.constants';

const profilePage = () => import(/* webpackChunkName: "profile" */ '@/pages/profile');
const profile = () => import(/* webpackChunkName: "profile" */ '@/components/profile/Profile');
const myClass = () => import(/* webpackChunkName: "profile" */ '@/pages/myClass');
const activity = () => import(/* webpackChunkName: "profile" */ '@/pages/activity');
const oldClasses = () => import(/* webpackChunkName: "profile" */ '@/pages/oldClasses');
const createClass = () => import(/* webpackChunkName: "profile" */ '@/pages/createClass');
const showSchoolClassCode = () => import(/* webpackChunkName: "profile" */ '@/pages/me/showSchoolClassCode');
const showTeamCode = () => import(/* webpackChunkName: "profile" */ '@/pages/me/showTeamCode');
const myTeam = () => import(/* webpackChunkName: "profile" */ '@/pages/me/myTeam');
const joinTeam = () => import(/* webpackChunkName: "profile" */ '@/pages/me/joinTeam');
const createTeam = () => import(/* webpackChunkName: "profile" */ '@/pages/me/createTeam');

export default [
  {
    path: '/me',
    component: profilePage,
    children: [
      { path: 'profile', name: 'profile', component: profile, meta: { isProfile: true } },
      { path: 'class', alias: 'my-class', name: 'my-class', component: myClass, meta: { isProfile: true } },
      { path: 'activity', name: 'activity', component: activity, meta: { isProfile: true } },
      { path: '', name: 'profile-activity', component: activity, meta: { isProfile: true } },
      {
        path: 'old-classes',
        name: 'old-classes',
        component: oldClasses,
        meta: { isProfile: true },
      },
      {
        path: 'class/create',
        alias: 'create-class',
        name: 'create-class',
        component: createClass,
        meta: { layout: LAYOUT_SIMPLE },
      },
      {
        path: 'class/code',
        alias: 'show-code',
        name: SHOW_SCHOOL_CLASS_CODE,
        component: showSchoolClassCode,
        meta: { layout: LAYOUT_SIMPLE },
      },
      { path: 'team', name: MY_TEAM, component: myTeam, meta: { isProfile: true } },
      { path: 'team/join', name: JOIN_TEAM, component: joinTeam, meta: { isProfile: true, layout: LAYOUT_SIMPLE } },
      {
        path: 'team/create',
        name: CREATE_TEAM,
        component: createTeam,
        meta: { isProfile: true, layout: LAYOUT_SIMPLE },
      },
      {
        path: 'team/code',
        name: SHOW_TEAM_CODE,
        component: showTeamCode,
        meta: { layout: LAYOUT_SIMPLE },
      },
    ],
  },
];
