{"size": 1136, "ext": "js", "max_stars_repo_path": "src/helpers/nav.js", "max_stars_repo_name": "ditopixels/EduSync", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/helpers/nav.js", "max_issues_repo_name": "ditopixels/EduSync", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/helpers/nav.js", "max_forks_repo_name": "ditopixels/EduSync", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.4117647059, "max_line_length": 81, "alphanum_fraction": 0.4876760563}
export function admin(path) {
    return getNavegator(path, [
        { categorie: 'Inicio', path: '/app' },
        {
            categorie: 'Institución',
            path: '/app',
            subCategories: [
                { subCategorie: 'Pagina', path: '/app/pagina' },
                { subCategorie: 'Configuracion', path: '/app/configuracion' },
                { subCategorie: 'Miembros', path: '/app/miembros' }
            ]
        },
        { categorie: 'Biblioteca', path: '/app/biblioteca' },
        { categorie: 'Documentos', path: '/app/documentos' }
    ])
}

function getNavegator(path, nav) {
    path = path.toLowerCase().split('/')
    nav.forEach(el => {
        if (path[2] && el.categorie.toLowerCase() == path[2].toLowerCase()) {
            el.class = 'active'
        } else if (el.subCategories) {
            el.subCategories.forEach((el) => {
                if (el.subCategorie.toLowerCase() == path[2]) el.class = 'active'
                else el.class = ''
            })
        } else {
            el.class = ''
            if (!path[2]) nav[0].class = 'active'
        }
    })
    return nav
}