import { __assign, __extends } from "tslib";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Component } from 'react';
import cx from 'classnames';
import Placeholder from '../placeholder';
import isNil from '../utils/isNil';
var Card = (function (_super) {
    __extends(Card, _super);
    function Card() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Card.prototype.render = function () {
        var _a = this.props, title = _a.title, action = _a.action, type = _a.type, loading = _a.loading, style = _a.style, children = _a.children, className = _a.className, bodyStyle = _a.bodyStyle;
        var isValidTitle = !isNil(title);
        var isValidAction = !isNil(action);
        return (_jsxs("div", __assign({ className: cx('zent-card', className, {
                'zent-card--normal': type === 'normal',
                'zent-card--nested': type === 'nested',
            }), style: style, "data-zv": 'v10.0.11' }, { children: [(isValidTitle || isValidAction) && (_jsxs("div", __assign({ className: "zent-card-header", "data-zv": 'v10.0.11' }, { children: [isValidTitle && (_jsx("h3", __assign({ className: "zent-card-header__title", "data-zv": 'v10.0.11' }, { children: title }), void 0)), isValidAction && (_jsx("div", __assign({ className: "zent-card-header__action", "data-zv": 'v10.0.11' }, { children: action }), void 0))] }), void 0)), _jsx("div", __assign({ className: "zent-card-body", style: bodyStyle, "data-zv": 'v10.0.11' }, { children: loading ? _jsx(Placeholder.TextBlock, { rows: 5 }, void 0) : children }), void 0)] }), void 0));
    };
    Card.defaultProps = {
        type: 'normal',
        style: {},
        bodyStyle: {},
        loading: false,
        className: '',
    };
    return Card;
}(Component));
export { Card };
export default Card;
