'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _tslib = require('../../../_virtual/_tslib.js');
var React = require('react');
var index = require('../../../utils/index.js');
var styles = require('../styles.js');
var ModalHeader = require('./ModalHeader.js');
var ModalActions = require('./ModalActions.js');
var DialogLoading = require('./DialogLoading.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

function DialogContent(_a) {
    var { children, onClose, pinnedFooter, action, variant, hideCloseIcon, title, primaryAction, dismissAction, stackedActionButtons, isLoading } = _a, props = _tslib.__rest(_a, ["children", "onClose", "pinnedFooter", "action", "variant", "hideCloseIcon", "title", "primaryAction", "dismissAction", "stackedActionButtons", "isLoading"]);
    const appendTestId = index.getId(props['data-testid']);
    const appendTrackId = index.getId(props['data-trackid']);
    return (React__default['default'].createElement(React__default['default'].Fragment, null,
        title && title.text && (React__default['default'].createElement(ModalHeader.ModalHeader, { onClose: onClose, hideCloseIcon: hideCloseIcon, mode: title.mode, variant: variant, "data-testid": appendTestId('dialog-header'), "data-trackid": appendTrackId('dialog-header') }, title.text)),
        React__default['default'].createElement(styles.StyledModalContent, { pinnedFooter: pinnedFooter, stackedActionButtons: stackedActionButtons, action: action, "data-testid": appendTestId('dialog-content'), "data-trackid": appendTrackId('dialog-content'), variant: variant },
            isLoading ? (React__default['default'].createElement(DialogLoading.DialogLoading, { "data-testid": appendTestId('dialog-loading'), "data-trackid": appendTrackId('dialog-loading') })) : (React__default['default'].createElement(React__default['default'].Fragment, null, children)),
            action && (React__default['default'].createElement(styles.ModalFooter, { pinnedFooter: pinnedFooter, stackedActionButtons: stackedActionButtons, "data-testid": appendTestId('dialog-footer'), "data-trackid": appendTrackId('dialog-footer'), variant: variant },
                action === 'confirm' && primaryAction && dismissAction && (React__default['default'].createElement(ModalActions.ModalActions, { primaryAction: primaryAction, dismissAction: dismissAction, variant: variant, stackedActionButtons: stackedActionButtons, "data-testid": appendTestId(), "data-trackid": appendTrackId() })),
                action === 'acknowledge' && primaryAction && (React__default['default'].createElement(ModalActions.ModalActions, { primaryAction: primaryAction, variant: variant, stackedActionButtons: stackedActionButtons, "data-testid": appendTestId(), "data-trackid": appendTrackId() })))))));
}

exports.DialogContent = DialogContent;
