import { ui18n } from '@/lang'

export enum RoutesName {
  login = 'login',
  personal = 'personal',
  projects = 'projects',
  project = 'project',
  projectScenes = 'projectScenes',
  projectMembers = 'projectMembers',
  projectMaterial = 'projectInfos',
  projectTaggings = 'projectMarking',
  projectRoles = 'projectRole'
}

export const routesPaths = {
  [RoutesName.login]: 'login',
  [RoutesName.personal]: 'personal',
  [RoutesName.projects]: 'projects',

  [RoutesName.project]: 'project/:id',
  [RoutesName.projectScenes]: 'scenes',
  [RoutesName.projectMembers]: 'members',
  [RoutesName.projectMaterial]: 'infos',
  [RoutesName.projectTaggings]: 'taggings',
  [RoutesName.projectRoles]: 'roles'
}

export const routesMetas = {
  [RoutesName.login]: {
    title: ui18n.t('sys.router.login')
  },
  [RoutesName.personal]: {
    title: ui18n.t('sys.router.personal'),
    icon: ''
  },
  [RoutesName.projects]: {
    title: ui18n.t('sys.router.projects'),
    icon: ''
  },
  [RoutesName.projectScenes]: {
    title: ui18n.t('sys.router.projectScenes')
  },
  [RoutesName.projectMaterial]: {
    title: ui18n.t('sys.router.projectMaterial')
  },
  [RoutesName.projectMembers]: {
    title: ui18n.t('sys.router.projectMembers')
  },
  [RoutesName.projectTaggings]: {
    title: ui18n.t('sys.router.projectTaggings')
  },
  [RoutesName.projectRoles]: {
    title: ui18n.t('sys.router.projectRoles')
  },
  [RoutesName.project]: {
    title: ui18n.t('sys.router.project')
  }
}

export type RouteTree = { name: RoutesName; children?: RouteTree[] }

export const routeTrees: RouteTree[] = [
  { name: RoutesName.personal },
  {
    name: RoutesName.projects,
    children: [
      {
        name: RoutesName.project,
        children: [
          { name: RoutesName.projectMaterial },
          { name: RoutesName.projectMembers },
          { name: RoutesName.projectTaggings },
          { name: RoutesName.projectScenes },
          { name: RoutesName.projectRoles }
        ]
      }
    ]
  }
]
