"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "MaintenanceDialog", {
    enumerable: true,
    get: function() {
        return MaintenanceDialog;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _dialog = require("../../../dialog");
const _react = require("react");
const _datefns = require("date-fns");
const _utc = require("@date-fns/utc");
function getTimeString(timestamp) {
    const date = (0, _datefns.format)(new _utc.UTCDateMini(timestamp), "MMM dd");
    const time = (0, _datefns.format)(new _utc.UTCDateMini(timestamp), "h:mm aa");
    return `${time} (UTC) on ${date}`;
}
function MaintenanceDialog({ brokerName, endTime, open, onOpenChange }) {
    const endDate = (0, _react.useMemo)(()=>{
        return getTimeString(endTime);
    }, [
        endTime
    ]);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.Dialog, {
        open: open,
        children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dialog.DialogContent, {
            closable: false,
            children: [
                /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogHeader, {
                    children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogTitle, {
                        className: "orderly-text-xs  orderly-font-semibold desktop:!orderly-text-base",
                        children: "System upgrade in progress"
                    })
                }),
                /*#__PURE__*/ (0, _jsxruntime.jsx)(_dialog.DialogBody, {
                    children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
                        className: "orderly-flex orderly-gap-1 orderly-font-semibold orderly-text-base-contrast-54 orderly-pt-5 orderly-text-2xs desktop:!orderly-text-xs",
                        children: [
                            "Sorry, ",
                            brokerName,
                            " is temporarily unavailable due to a scheduled upgrade. The service is expected to be back by ",
                            endDate,
                            "."
                        ]
                    })
                })
            ]
        })
    });
}

//# sourceMappingURL=maintenanceDialog.js.map