var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
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 { ConnectedDevice } from './ConnectedDevice';
import { ConfirmationsEdit } from './ConfirmationsEdit';
import { FeatureFlag } from '../../commons/FeatureFlag';
export var ConnectedDevices = function (_a) {
    var devicesList = _a.devicesList, deployedWallet = _a.deployedWallet, devicesBasePath = _a.devicesBasePath;
    var _b = __read(useState(''), 2), confirmationsCount = _b[0], setConfirmationsCount = _b[1];
    return (React.createElement("div", { className: "connected-devices" },
        React.createElement("div", { className: "connected-devices-header" },
            React.createElement("h2", { className: "connected-devices-title" },
                devicesList.length,
                " connected devices"),
            React.createElement(FeatureFlag, { sdk: deployedWallet.sdk, feature: "requiredConfirmations" },
                React.createElement(ConfirmationsEdit, { confirmationsCount: confirmationsCount, setConfirmationsCount: function (confirmations) { return setConfirmationsCount(confirmations); }, deployedWallet: deployedWallet, devicesAmount: devicesList.length }))),
        React.createElement("ul", { className: "connected-devices-list" }, devicesList.map(function (device) {
            return (React.createElement(ConnectedDevice, __assign({ key: device.publicKey, confirmationsCount: confirmationsCount, devicesAmount: devicesList.length, deployedWallet: deployedWallet, devicesBasePath: devicesBasePath }, device)));
        }))));
};
//# sourceMappingURL=ConnectedDevices.js.map