import React, { useContext } from 'react';
import { QuestionContext } from '../context/QuestionContext';
import classNames from 'classnames';
import { formatQuestionDisplayNumber } from '../../formatting';
import { Score } from '../shared/Score';
const QuestionTitle = ({ element, renderChildNodes }) => {
    const { displayNumber, maxScore, level } = useContext(QuestionContext);
    const Tag = `h${Math.min(3 + level, 6)}`;
    return (React.createElement(React.Fragment, null,
        React.createElement(Tag, { className: classNames('exam-question-title', { 'e-normal e-font-size-m': level > 0 }) },
            React.createElement("strong", { className: classNames('exam-question-title__display-number', {
                    'exam-question-title__display-number--indented': level > 0
                }) }, `${formatQuestionDisplayNumber(displayNumber)} `),
            renderChildNodes(element),
            " ",
            React.createElement(Score, { score: maxScore, size: level === 0 ? 'large' : 'small' }))));
};
export default QuestionTitle;
//# sourceMappingURL=QuestionTitle.js.map