import { isUndefined } from '@/utils/is';
import { appRoutes, appExternalRoutes } from '../routes';

const mixinRoutes = [...appRoutes, ...appExternalRoutes];

const appClientMenus = mixinRoutes
  .filter(el => isUndefined(el.meta.showInMenu) || el.meta.showInMenu)
  .map(el => {
    const { name, path, meta, redirect, children } = el;
    return {
      name,
      path,
      meta,
      redirect,
      children
    };
  });

export default appClientMenus;
