import React, { useContext } from 'react';
import { QuestionContext } from '../context/QuestionContext';
import { questionTitleId } from '../../ids';
import { formatQuestionDisplayNumber } from '../../formatting';
function QuestionTitle({ element, renderChildNodes }) {
    const { displayNumber, hasExternalMaterial } = useContext(QuestionContext);
    return hasExternalMaterial ? (React.createElement(React.Fragment, null,
        React.createElement("div", { className: "anchor", id: `question-nr-${displayNumber}` }),
        React.createElement("h2", { id: questionTitleId(displayNumber) },
            formatQuestionDisplayNumber(displayNumber),
            " ",
            renderChildNodes(element)))) : null;
}
export default React.memo(QuestionTitle);
//# sourceMappingURL=QuestionTitle.js.map