stackpress
Version:
Incept is a content management framework.
9 lines (8 loc) • 583 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = LayoutMenu;
const jsx_runtime_1 = require("react/jsx-runtime");
function LayoutMenu(props) {
const { path = '', menu = [] } = props;
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: menu.map((item, index) => ((0, jsx_runtime_1.jsxs)("a", { className: `menu-item ${path.startsWith(item.match) ? 'active' : ''}`, href: item.path, children: [item.icon && ((0, jsx_runtime_1.jsx)("i", { className: `icon fas fa-fw fa-${item.icon}` })), item.name] }, index))) }));
}