import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import clsx from "clsx";
import { ClickableText, GetSvgIcon, RangeComponent, TextPillNotClickable, } from "..";
import { convertTo10KFormat } from "../../utils";
import EllipsisText from "../EllipsisText";
import "./style.scss";
import { useState } from "react";
const AdvanceFilterJobTitleV2 = ({ setMaxValue = 500, setMinValue = 0, searchForPillText = "Cheif Executive Osa asd asd sad sas sdfsdf sdf sdfsd fds f asdasd sad saafficer", crossOnClick, applyToAllOnClick, getRange = () => { }, showApplyToAll = true, dataCy, disabled = false, }) => {
    const [hasBeenChanged, setHasBeenChanged] = useState(false);
    return (_jsx("div", { style: { width: "100%" }, children: _jsxs("div", { className: "advanceFilterJobTitleV2--Generic", children: [_jsxs("div", { children: [_jsx(EllipsisText, { children: searchForPillText }), _jsx("button", { onClick: crossOnClick, "data-cy": `${dataCy}-delete`, disabled: disabled, children: _jsx(GetSvgIcon, { iconType: "delete", iconSize: "24" }) })] }), _jsxs("div", { className: clsx({
                        "advanceFilterJobTitleV2-SliderContainer--Justified": showApplyToAll,
                        "advanceFilterJobTitleV2-SliderContainer--Gapped": !showApplyToAll,
                    }), children: [_jsx(RangeComponent, { minValue: setMinValue, maxValue: setMaxValue, getRange: (value) => {
                                // setRangeData(value);
                                setHasBeenChanged(true);
                                getRange(value);
                            }, disabled: disabled }), _jsx("span", { className: "advanceFilterJobTitleV2-RangePill", children: _jsx(TextPillNotClickable, { text: `${convertTo10KFormat(setMinValue)}-${convertTo10KFormat(setMaxValue)}`, sizeVariant: "sm", isSelected: true, hasBorder: true }) }), showApplyToAll && (_jsx(ClickableText, { onClick: () => {
                                applyToAllOnClick({
                                    minRange: setMinValue,
                                    maxRange: setMaxValue,
                                });
                                setHasBeenChanged(false);
                            }, showIcon: false, sizeVariant: "sm", text: "Apply to all", colorVariant: hasBeenChanged ? "orange" : "gray", dataCy: `${dataCy}-apply-to-all`, disabled: disabled }))] })] }) }));
};
//
export default AdvanceFilterJobTitleV2;
