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;
};
import React, { useState } from 'react';
import { NavLink } from 'react-router-dom';
import { useAsyncEffect } from '../hooks/useAsyncEffect';
export var Nav = function (_a) {
    var deployedWallet = _a.deployedWallet;
    var _b = __read(useState(false), 2), newNotifications = _b[0], setNewNotifications = _b[1];
    var updateNotifictions = function (notifications) { return setNewNotifications(notifications.length !== 0); };
    useAsyncEffect(function () { return deployedWallet.subscribeAuthorisations(updateNotifictions); }, [deployedWallet]);
    return (React.createElement(React.Fragment, null,
        React.createElement(NavLink, { className: "udashboard-tab udashboard-tab-funds", activeClassName: "active", to: "/dashboard/funds" },
            React.createElement("span", { className: "udashboard-tab-text" }, "Funds")),
        React.createElement(NavLink, { className: "udashboard-tab udashboard-tab-devices", activeClassName: "active", to: "/dashboard/devices" },
            React.createElement("span", { className: "udashboard-tab-text " + (newNotifications && 'new-notifications') }, "Devices")),
        React.createElement(NavLink, { className: "udashboard-tab udashboard-tab-backup", activeClassName: "active", to: "/dashboard/backup" },
            React.createElement("span", { className: "udashboard-tab-text" }, "Backup"))));
};
//# sourceMappingURL=Nav.js.map