"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var vdom_1 = require("@dojo/framework/core/vdom");
var theme_1 = require("../middleware/theme");
var css = require("../theme/default/result.m.css");
var iconCss = require("../theme/default/icon.m.css");
var icon_1 = require("../icon");
var StatusIcon;
(function (StatusIcon) {
    StatusIcon["alert"] = "alertIcon";
    StatusIcon["error"] = "cancelIcon";
    StatusIcon["info"] = "infoIcon";
    StatusIcon["success"] = "checkedBoxIcon";
})(StatusIcon = exports.StatusIcon || (exports.StatusIcon = {}));
var factory = vdom_1.create({ theme: theme_1.default })
    .properties()
    .children();
exports.Result = factory(function Result(_a) {
    var children = _a.children, properties = _a.properties, theme = _a.middleware.theme;
    var themeCss = theme.classes(css);
    var _b = properties(), title = _b.title, subtitle = _b.subtitle, status = _b.status, classes = _b.classes, variant = _b.variant;
    var _c = children()[0] || {}, actionButtons = _c.actionButtons, content = _c.content, icon = _c.icon;
    return (vdom_1.tsx("div", { key: "root", classes: [theme.variant(), themeCss.root] },
        (icon || status) && (vdom_1.tsx("div", { key: "iconWrapper", classes: [
                themeCss.iconWrapper,
                status ? themeCss[status] : null,
                status && !icon ? themeCss.statusIcon : null
            ] }, icon ? (icon) : (vdom_1.tsx(icon_1.default, { key: "icon", type: StatusIcon[status], theme: theme.compose(iconCss, css, 'icon'), classes: classes, variant: variant })))),
        title && (vdom_1.tsx("div", { classes: themeCss.titleWrapper },
            vdom_1.tsx("h2", { classes: themeCss.title }, title),
            subtitle && vdom_1.tsx("h3", { classes: themeCss.subtitle }, subtitle))),
        content && vdom_1.tsx("div", { classes: themeCss.contentWrapper }, content),
        actionButtons && (vdom_1.tsx("div", { key: "actions", classes: themeCss.actions }, actionButtons && vdom_1.tsx("div", { classes: themeCss.actionButtons }, actionButtons)))));
});
exports.default = exports.Result;

/*# sourceMappingURL=index.js.map*/