var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { BottomSection } from './BottomSection';
import { Cancel } from './QuestionHeader';
import { defaultSurveyAppearance, getContrastingTextColor, renderChildrenAsTextOrHtml } from '../surveys-utils';
import { h } from 'preact';
export function ConfirmationMessage(_a) {
    var header = _a.header, description = _a.description, contentType = _a.contentType, forceDisableHtml = _a.forceDisableHtml, appearance = _a.appearance, onClose = _a.onClose, styleOverrides = _a.styleOverrides;
    var textColor = getContrastingTextColor(appearance.backgroundColor || defaultSurveyAppearance.backgroundColor);
    return (<>
            <div className="thank-you-message" style={__assign({}, styleOverrides)}>
                <div className="thank-you-message-container">
                    <Cancel onClick={function () { return onClose(); }}/>
                    <h3 className="thank-you-message-header" style={{ color: textColor }}>
                        {header}
                    </h3>
                    {description &&
            renderChildrenAsTextOrHtml({
                component: h('div', { className: 'thank-you-message-body' }),
                children: description,
                renderAsHtml: !forceDisableHtml && contentType !== 'text',
                style: { color: textColor },
            })}
                    <BottomSection text={'Close'} submitDisabled={false} appearance={appearance} onSubmit={function () { return onClose(); }}/>
                </div>
            </div>
        </>);
}
//# sourceMappingURL=ConfirmationMessage.jsx.map