import { __rest } from '../../../_virtual/_tslib.js';
import React__default from 'react';
import { getId } from '../../../utils/index.js';
import { StyledModalContent, ModalFooter } from '../styles.js';
import { ModalHeader } from './ModalHeader.js';
import { ModalActions } from './ModalActions.js';
import { DialogLoading } from './DialogLoading.js';

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

export { DialogContent };
