import { h } from "@stencil/core";
import { BEM } from "../../../utils/bem";
export const SectionList = ({ items }) => {
    const block = BEM.block('nav');
    const hasNoItems = !(items && items.length > 0);
    if (hasNoItems) {
        return '';
    }
    return (h("ul", { class: Object.assign({}, block.element('mobile-section-list').class()) }, items === null || items === void 0 ? void 0 : items.map(itemGroup => {
        var _a;
        return (h("li", null, h("a", { class: Object.assign({}, block.element('mobile-section-item').class()), href: itemGroup.href, target: itemGroup.target }, itemGroup.label), itemGroup.linkItems && itemGroup.linkItems.length > 0 ? (h("ul", { class: Object.assign({}, block.element('mobile-links-list').class()) }, (_a = itemGroup.linkItems) === null || _a === void 0 ? void 0 : _a.map(item => {
            return (h("li", null, h("a", { class: Object.assign({}, block.element('mobile-links').class()), href: item.href, target: item.target }, item.label)));
        }))) : ('')));
    })));
};
