import React, { useContext } from 'react';
import { SectionContext } from '../context/SectionContext';
import { findChildElement } from '../../dom-utils';
import { TOCSectionTitle } from './TOCSectionTitle';
import { tocSectionTitleId } from '../../ids';
export const TOCSection = ({ element, answers, renderChildNodes, renderComponentOverrides }) => {
    const { displayNumber } = useContext(SectionContext);
    const sectionTitle = findChildElement(element, 'section-title');
    return (React.createElement("li", { "data-section-id": displayNumber },
        sectionTitle && (React.createElement(TOCSectionTitle, { element: sectionTitle,
            renderChildNodes,
            renderComponentOverrides,
            answers })),
        React.createElement("ol", { className: "e-list-data e-pad-l-0", "aria-labelledby": sectionTitle && tocSectionTitleId(displayNumber) }, renderChildNodes(element, 1 /* RenderOptions.SkipHTML */))));
};
//# sourceMappingURL=TOCSection.js.map