'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 Close = require('../../../../icons/Close.js');
var styles = require('./styles.js');
var index$1 = require('../../../IconButton/index.js');

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

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

const ButtonSheetImage = (_a) => {
    var { imgValues = {
        imgAlt: '',
        objectFit: 'cover',
        objectPosition: 'center',
        asHeader: false,
        imgSrc: '',
        imgHeight: '',
    }, headerControlsModifiers, onClose } = _a, props = _tslib.__rest(_a, ["imgValues", "headerControlsModifiers", "onClose"]);
    const appendTestId = index.getId(`${props['data-testid']}-bottom-sheet-image`);
    const appendTrackId = index.getId(`${props['data-trackid']}-bottom-sheet-image`);
    return imgValues ? (React__default['default'].createElement(styles.ButtonSheetImageWrapper, { imgHeight: imgValues.imgHeight },
        React__default['default'].createElement(styles.ImageStyled, { src: imgValues.imgSrc, alt: imgValues.imgAlt, objectFit: imgValues.objectFit, objectPosition: imgValues.objectPosition, asHeader: imgValues.asHeader, loading: "lazy" }),
        headerControlsModifiers === 'close' && imgValues.asHeader && (React__default['default'].createElement(index$1.IconButton, { size: "x-small", variant: "secondary", icon: React__default['default'].createElement(Close['default'], null), onClick: onClose, "data-testid": appendTestId('close-button'), "data-trackid": appendTrackId('close-button') })))) : null;
};

exports['default'] = ButtonSheetImage;
