import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { OrderType } from "@orderly.network/types";
import { Circle } from "lucide-react";
export const OrderTypesCheckbox = ({ value, onValueChange })=>{
    return /*#__PURE__*/ _jsxs("div", {
        className: "orderly-flex orderly-items-center orderly-space-x-3",
        children: [
            /*#__PURE__*/ _jsx(OrderTypeItem, {
                id: "orderly-order-entry-expand-content-post-only",
                active: value === OrderType.POST_ONLY,
                label: "Post only",
                value: OrderType.POST_ONLY,
                onClick: onValueChange
            }),
            /*#__PURE__*/ _jsx(OrderTypeItem, {
                id: "orderly-order-entry-expand-content-ioc",
                active: value === OrderType.IOC,
                label: "IOC",
                value: OrderType.IOC,
                onClick: onValueChange
            }),
            /*#__PURE__*/ _jsx(OrderTypeItem, {
                id: "orderly-order-entry-expand-content-fok",
                active: value === OrderType.FOK,
                label: "FOK",
                value: OrderType.FOK,
                onClick: onValueChange
            })
        ]
    });
};
const OrderTypeItem = (props)=>{
    let clsName = "orderly-flex orderly-items-center orderly-gap-1 orderly-cursor-pointer";
    if (props.active) {
        clsName += " orderly-text-base-contrast";
    } else {
        clsName += " orderly-text-base-contrast-54";
    }
    return /*#__PURE__*/ _jsxs("div", {
        id: props.id,
        className: clsName,
        onClick: ()=>{
            props.onClick(props.active ? "" : props.value);
        },
        children: [
            /*#__PURE__*/ _jsx("button", {
                type: "button",
                className: "orderly-order-entry-radio-button orderly-w-[14px] orderly-h-[14px] orderly-rounded-full orderly-border-2 orderly-border-base-contrast-20",
                children: props.active && // @ts-ignore
                /*#__PURE__*/ _jsx(Circle, {
                    className: "orderly-order-entry-radio-circle orderly-w-[10px] orderly-h-[10px] orderly-text-link orderly-bg-link orderly-rounded-full"
                })
            }),
            /*#__PURE__*/ _jsx("span", {
                className: "orderly-text-3xs",
                children: props.label
            })
        ]
    });
};

//# sourceMappingURL=orderTypes.js.map