@vectara/vectara-ui
Version:
Vectara's design system, codified as a React and Sass component library
12 lines (11 loc) • 945 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { VuiAppSideNavLink } from "./AppSideNavLink";
export const buildSections = (sections) => {
return (_jsx("div", Object.assign({ className: "vuiAppSideNavSections" }, { children: sections.map(({ name, pages }) => {
const renderedPages = pages.map(({ name, path }) => (_jsx(VuiAppSideNavLink, { path: path, name: name }, path !== null && path !== void 0 ? path : name)));
return (_jsx(VuiAppSideNavSection, Object.assign({ name: name }, { children: renderedPages }), name));
}) })));
};
const VuiAppSideNavSection = ({ name, children }) => {
return (_jsxs("div", Object.assign({ className: "vuiAppSideNavSection" }, { children: [_jsx("div", Object.assign({ className: "vuiAppSideNavSection__title" }, { children: name })), _jsx("div", Object.assign({ className: "vuiAppSideNavSection__items" }, { children: children }))] }), name));
};