import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
import React from "react";
import classNames from "classnames";
import { View } from "@tarojs/components";
export var defaultContentProps = {
    visible: false,
    title: '',
    header: '',
    footer: '',
    close: '',
    footerDirection: 'horizontal',
    onClick: function() {}
};
export var Content = function(props) {
    var _$_object_spread = _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() {
        return title && /*#__PURE__*/ React.createElement(View, {
            className: "".concat(classPrefix, "-header")
        }, title);
    };
    var renderFooter = function() {
        return footer && /*#__PURE__*/ React.createElement(View, {
            className: classNames("".concat(classPrefix, "-footer"), _define_property({}, footerDirection, footerDirection))
        }, footer);
    };
    var handleClick = function(e) {
        onClick(e);
    };
    return /*#__PURE__*/ React.createElement(View, {
        className: classNames("".concat(classPrefix, "-outer"), className),
        style: style,
        onClick: function(e) {
            return handleClick(e);
        }
    }, close, header, /*#__PURE__*/ React.createElement(View, {
        className: classPrefix,
        style: {
            display: visible ? 'flex' : 'none'
        }
    }, renderHeader(), /*#__PURE__*/ React.createElement(View, {
        className: "".concat(classPrefix, "-content")
    }, children), renderFooter()));
};
Content.displayName = 'NutContent';
