"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get Content () {
        return Content;
    },
    get defaultContentProps () {
        return defaultContentProps;
    }
});
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
var _define_property = require("@swc/helpers/_/_define_property");
var _object_spread = require("@swc/helpers/_/_object_spread");
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
var _components = require("@tarojs/components");
var defaultContentProps = {
    visible: false,
    title: '',
    header: '',
    footer: '',
    close: '',
    footerDirection: 'horizontal',
    onClick: function onClick() {}
};
var Content = function Content(props) {
    var _$_object_spread = (0, _object_spread._)({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick;
    var classPrefix = 'nut-dialog';
    var renderHeader = function renderHeader() {
        return title && /*#__PURE__*/ _react.default.createElement(_components.View, {
            className: "".concat(classPrefix, "-header")
        }, title);
    };
    var renderFooter = function renderFooter() {
        return footer && /*#__PURE__*/ _react.default.createElement(_components.View, {
            className: (0, _classnames.default)("".concat(classPrefix, "-footer"), (0, _define_property._)({}, footerDirection, footerDirection))
        }, footer);
    };
    var handleClick = function handleClick(e) {
        onClick(e);
    };
    return /*#__PURE__*/ _react.default.createElement(_components.View, {
        className: (0, _classnames.default)("".concat(classPrefix, "-outer"), className),
        style: style,
        onClick: function onClick(e) {
            return handleClick(e);
        }
    }, close, header, /*#__PURE__*/ _react.default.createElement(_components.View, {
        className: classPrefix,
        style: {
            display: visible ? 'flex' : 'none'
        }
    }, renderHeader(), /*#__PURE__*/ _react.default.createElement(_components.View, {
        className: "".concat(classPrefix, "-content")
    }, children), renderFooter()));
};
Content.displayName = 'NutContent';
