"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const moment_1 = __importDefault(require("moment"));
const ethers_1 = require("ethers");
class PaymentStatusParams {
    constructor(state) {
        this.state = state;
    }
}
const LinkList = (props) => {
    const { links } = props;
    return (react_1.default.createElement("div", null, links === null || links === void 0 ? void 0 : links.map((link, index) => (react_1.default.createElement("div", { key: index },
        react_1.default.createElement("h2", null, link.counterPartyAccount),
        link.pushPayments.map((pushPayment, index) => (react_1.default.createElement("div", { key: index },
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Push Payment: "),
                "Payment ",
                pushPayment.id),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "To: "),
                " ",
                pushPayment.to),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "From: "),
                " ",
                pushPayment.from),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "State: "),
                " ",
                new PaymentStatusParams(pushPayment.state).state),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Payment Token: "),
                " ",
                pushPayment.paymentToken),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Required Stake: "),
                " ",
                ethers_1.utils.formatUnits(pushPayment.requiredStake, "wei")),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Amount Staked: "),
                " ",
                ethers_1.utils.formatUnits(pushPayment.amountStaked, "wei")),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Expiration Date: "),
                " ",
                moment_1.default.unix(pushPayment.expirationDate).format()),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Created: "),
                " ",
                pushPayment.createdTimestamp.toString()),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Updated: "),
                " ",
                pushPayment.updatedTimestamp.toString()),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Collateral Recovered: "),
                " ",
                ethers_1.utils.formatUnits(pushPayment.collateralRecovered, "wei")),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Dispute Mediator: "),
                " ",
                pushPayment.merchantUrl),
            react_1.default.createElement("p", null,
                react_1.default.createElement("b", null, "Payment Amount: "),
                " ",
                ethers_1.utils.formatUnits(pushPayment.paymentAmount, "wei"))))),
        react_1.default.createElement("br", null),
        react_1.default.createElement("hr", null))))));
};
exports.default = LinkList;
//# sourceMappingURL=LinkList.js.map