@conductionnl/nl-design-system
Version:
NL design system components created by Conduction
26 lines (25 loc) • 1.2 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sidenav = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
/**
* This components renders bootstrap Sidenav.
*
* @returns JSX of the generated Sidenav.
*/
function Sidenav(props) {
var liNav = props.items.map(function (item) { return ((0, jsx_runtime_1.jsx)("li", __assign({ className: "nav-item" }, { children: (0, jsx_runtime_1.jsx)("a", __assign({ className: "nav-link ".concat(item.active !== null && item.active), "aria-current": item.current !== null && item.current, href: item.href !== null ? item.href : "#" }, { children: item.name }), void 0) }), item.name)); });
return (0, jsx_runtime_1.jsx)("ul", __assign({ className: "nav flex-column" }, { children: liNav }), void 0);
}
exports.Sidenav = Sidenav;