"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;
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importStar(require("react"));
var react_router_dom_1 = require("react-router-dom");
var useAsyncEffect_1 = require("../hooks/useAsyncEffect");
exports.Nav = function (_a) {
    var deployedWallet = _a.deployedWallet;
    var _b = __read(react_1.useState(false), 2), newNotifications = _b[0], setNewNotifications = _b[1];
    var updateNotifictions = function (notifications) { return setNewNotifications(notifications.length !== 0); };
    useAsyncEffect_1.useAsyncEffect(function () { return deployedWallet.subscribeAuthorisations(updateNotifictions); }, [deployedWallet]);
    return (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(react_router_dom_1.NavLink, { className: "udashboard-tab udashboard-tab-funds", activeClassName: "active", to: "/dashboard/funds" },
            react_1.default.createElement("span", { className: "udashboard-tab-text" }, "Funds")),
        react_1.default.createElement(react_router_dom_1.NavLink, { className: "udashboard-tab udashboard-tab-devices", activeClassName: "active", to: "/dashboard/devices" },
            react_1.default.createElement("span", { className: "udashboard-tab-text " + (newNotifications && 'new-notifications') }, "Devices")),
        react_1.default.createElement(react_router_dom_1.NavLink, { className: "udashboard-tab udashboard-tab-backup", activeClassName: "active", to: "/dashboard/backup" },
            react_1.default.createElement("span", { className: "udashboard-tab-text" }, "Backup"))));
};
//# sourceMappingURL=Nav.js.map