import React from "react" import { Translation } from "react-i18next" import Items from "schemas/sidebar" import { Icons, createIconRender } from "components/Icons" import "./index.less" export default class NavigationMenu extends React.Component { onClick = (id) => { window.app.location.push(`/${id}`) this.props.close() } generateMenus = (items) => { // group items it has children to a new array and the rest to a general array items = items.reduce((acc, item) => { if (item.children) { acc.push(item) } else { acc[0].children.push(item) } return acc }, [{ id: "general", title: "General", icon: "Home", children: [] }]) return items.map((group) => { return