import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
import React from "react";
import classNames from "classnames";
import { Tips, Warning, Failure, Ask, Success } from "@nutui/icons-react";
import { ComponentDefaults } from "../../utils/typings";
import { Button } from "../button/button";
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
    title: null,
    description: null,
    icon: '',
    status: 'info',
    actions: []
});
export var ResultPage = function(props) {
    var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, style = _$_object_spread.style, title = _$_object_spread.title, description = _$_object_spread.description, icon = _$_object_spread.icon, status = _$_object_spread.status, actions = _$_object_spread.actions, children = _$_object_spread.children;
    var classPrefix = "nut-resultpage";
    var cls = classNames(classPrefix, className);
    var defaultStatus = {
        success: /*#__PURE__*/ React.createElement(Success, {
            color: "#00D900"
        }),
        error: /*#__PURE__*/ React.createElement(Failure, {
            color: "#FF0F23"
        }),
        warning: /*#__PURE__*/ React.createElement(Warning, {
            color: "#FFBF00"
        }),
        info: /*#__PURE__*/ React.createElement(Tips, {
            color: "#0073FF"
        }),
        waiting: /*#__PURE__*/ React.createElement(Ask, {
            color: "#0073FF"
        })
    };
    return /*#__PURE__*/ React.createElement("div", {
        className: cls,
        style: style
    }, /*#__PURE__*/ React.createElement("div", {
        className: "".concat(classPrefix, "-icon")
    }, icon || defaultStatus[status]), typeof title === 'string' && title ? /*#__PURE__*/ React.createElement("div", {
        className: "".concat(classPrefix, "-title")
    }, title) : title, typeof description === 'string' && description ? /*#__PURE__*/ React.createElement("div", {
        className: "".concat(classPrefix, "-description")
    }, description) : description, actions.length ? /*#__PURE__*/ React.createElement("div", {
        className: "".concat(classPrefix, "-actions")
    }, actions.map(function(action, index) {
        var text = action.text, rest = _object_without_properties(action, [
            "text"
        ]);
        return /*#__PURE__*/ React.createElement("div", {
            className: "".concat(classPrefix, "-action"),
            key: index
        }, /*#__PURE__*/ React.createElement(Button, _object_spread_props(_object_spread({}, rest), {
            size: "large"
        }), action === null || action === void 0 ? void 0 : action.text));
    })) : null, children);
};
ResultPage.displayName = 'NutResultPage';
