import { SurveyContext, defaultSurveyAppearance, renderChildrenAsTextOrHtml } from '../surveys-utils';
import { cancelSVG } from '../icons';
import { useContext } from 'preact/hooks';
import { h } from 'preact';
export function QuestionHeader(_a) {
    var question = _a.question, description = _a.description, descriptionContentType = _a.descriptionContentType, backgroundColor = _a.backgroundColor, forceDisableHtml = _a.forceDisableHtml;
    return (<div style={{ backgroundColor: backgroundColor || defaultSurveyAppearance.backgroundColor }}>
            <div className="survey-question">{question}</div>
            {description &&
            renderChildrenAsTextOrHtml({
                component: h('div', { className: 'description' }),
                children: description,
                renderAsHtml: !forceDisableHtml && descriptionContentType !== 'text',
            })}
        </div>);
}
export function Cancel(_a) {
    var onClick = _a.onClick;
    var isPreviewMode = useContext(SurveyContext).isPreviewMode;
    return (<div className="cancel-btn-wrapper">
            <button className="form-cancel" onClick={onClick} disabled={isPreviewMode}>
                {cancelSVG}
            </button>
        </div>);
}
//# sourceMappingURL=QuestionHeader.jsx.map