"use strict";
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = require("react");
exports.useModalService = function () {
    var emptyModal = {
        name: 'none',
        props: {},
    };
    var _a = __read(react_1.useState(emptyModal), 2), modal = _a[0], setModal = _a[1];
    var showModal = function (name, props) {
        if (props === void 0) { props = {}; }
        return setModal({ name: name, props: props });
    };
    var hideModal = function () { return setModal(emptyModal); };
    return {
        modalName: modal.name,
        modalProps: modal.props,
        showModal: showModal,
        hideModal: hideModal,
    };
};
//# sourceMappingURL=useModalService.js.map