"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "PositionOverview", {
    enumerable: true,
    get: function() {
        return PositionOverview;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _statistic = require("../../statistic");
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
const _modal = require("../../modal");
const _checkbox = require("../../checkbox");
const _label = require("../../label");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const PositionOverview = (props)=>{
    const { aggregated } = props;
    const onMarketCloseAll = ()=>{
        _modal.modal.confirm({
            title: "Market Close All",
            content: "Are you sure you want to market close all positions?"
        }).then((res)=>{
            if (res) {
                props.onMarketCloseAll?.();
            }
        });
    };
    return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
        children: [
            /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
                id: "orderly-data-list-positions-header",
                className: "orderly-flex orderly-justify-between orderly-bg-base-900 orderly-px-4 orderly-pt-3",
                children: [
                    /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                        labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                        valueClassName: "orderly-text-3xs",
                        label: "Unreal. PnL",
                        value: aggregated?.unrealPnL,
                        coloring: true,
                        rule: "price"
                    }),
                    /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                        labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                        valueClassName: "orderly-text-3xs",
                        label: "Notional",
                        value: aggregated?.notional,
                        rule: "price"
                    }),
                    /*#__PURE__*/ (0, _jsxruntime.jsx)(_statistic.Statistic, {
                        label: "",
                        labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                        valueClassName: "orderly-text-3xs",
                        value: /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {}),
                        rule: "price",
                        coloring: true,
                        align: "right"
                    })
                ]
            }),
            /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
                className: "orderly-data-list-filter orderly-flex orderly-justify-between orderly-py-3 orderly-px-4 orderly-items-center",
                children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
                    className: "orderly-flex orderly-items-center orderly-gap-1",
                    children: [
                        /*#__PURE__*/ (0, _jsxruntime.jsx)(_checkbox.Checkbox, {
                            id: "showAll",
                            checked: props.showAllSymbol,
                            onCheckedChange: props.onShowAllSymbolChange
                        }),
                        /*#__PURE__*/ (0, _jsxruntime.jsx)(_label.Label, {
                            htmlFor: "showAll",
                            className: "orderly-text-base-contrast-54 orderly-text-3xs",
                            children: "Show all instruments"
                        })
                    ]
                })
            })
        ]
    });
};

//# sourceMappingURL=overview.js.map