import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Statistic } from "../../statistic";
import React from "react";
import { modal } from "../../modal";
import { Checkbox } from "../../checkbox";
import { Label } from "../../label";
export const PositionOverview = (props)=>{
    const { aggregated } = props;
    const onMarketCloseAll = ()=>{
        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__*/ _jsxs(_Fragment, {
        children: [
            /*#__PURE__*/ _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__*/ _jsx(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__*/ _jsx(Statistic, {
                        labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                        valueClassName: "orderly-text-3xs",
                        label: "Notional",
                        value: aggregated?.notional,
                        rule: "price"
                    }),
                    /*#__PURE__*/ _jsx(Statistic, {
                        label: "",
                        labelClassName: "orderly-text-4xs orderly-text-base-contrast-36",
                        valueClassName: "orderly-text-3xs",
                        value: /*#__PURE__*/ _jsx("div", {}),
                        rule: "price",
                        coloring: true,
                        align: "right"
                    })
                ]
            }),
            /*#__PURE__*/ _jsx("div", {
                className: "orderly-data-list-filter orderly-flex orderly-justify-between orderly-py-3 orderly-px-4 orderly-items-center",
                children: /*#__PURE__*/ _jsxs("div", {
                    className: "orderly-flex orderly-items-center orderly-gap-1",
                    children: [
                        /*#__PURE__*/ _jsx(Checkbox, {
                            id: "showAll",
                            checked: props.showAllSymbol,
                            onCheckedChange: props.onShowAllSymbolChange
                        }),
                        /*#__PURE__*/ _jsx(Label, {
                            htmlFor: "showAll",
                            className: "orderly-text-base-contrast-54 orderly-text-3xs",
                            children: "Show all instruments"
                        })
                    ]
                })
            })
        ]
    });
};

//# sourceMappingURL=overview.js.map