import check from '@/components/Authorized/CheckPermissions';
import React from 'react';
import { renderRoutes } from 'react-router-config';
import page403 from '@/pages/exception/403';
const Layout = ({ children, route }) => (
  <>
    {children ||
      renderRoutes(
        route.routes.map(r => {
          if (!r.authority) {
            return r;
          }
          r.component = check(r.authority, r.component, page403);
          return r;
        }),
      )}
  </>
);

export default Layout;