import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import "./style.scss";
import GetSvgIcon from "../GetSvgIcon";
import clsx from "clsx";
import { CircularIcon, ClickableText } from "..";
const FilterAddRemoveBadge = ({ text = "Placeholder Fitler", altImageType = "company", imagePath = "", onRemoveClick = () => { }, onAddClick, isRemoveSelected = false, isAddSelected = false, showErrorMessage = false, errorMessageText = "Remove", onErrorMessageClick = () => { }, onCrossClick = () => { }, showRemoveButton = true, props = {}, }) => {
    const handleRemovelick = () => {
        onRemoveClick(!isRemoveSelected);
    };
    const handleAddClick = () => {
        onAddClick(!isAddSelected);
    };
    const removeButtonClassName = clsx({
        "filterAddRemoveBadge-Button--Generic": true,
        "filterAddRemoveBadge-Remove--Unselected": !isRemoveSelected,
        "filterAddRemoveBadge-Remove--Selected": isRemoveSelected,
    });
    const addButtonClassName = clsx({
        "filterAddRemoveBadge-Button--Generic": true,
        "filterAddRemoveBadge-Add--Unselected": !isAddSelected,
        "filterAddRemoveBadge-Add--Selected": isAddSelected,
    });
    return (_jsxs("div", { className: "filterAddRemoveBadge--Wrapper", ...props, children: [!showErrorMessage && imagePath && (_jsx(CircularIcon, { altImageType: altImageType, iconPath: imagePath, iconSize: "24" })), showErrorMessage && (_jsx(GetSvgIcon, { iconType: "excalamationCircle", iconSize: "24" })), text, !showErrorMessage && (_jsxs("span", { children: [showRemoveButton && (_jsx("button", { className: removeButtonClassName, onClick: handleRemovelick, children: _jsx(GetSvgIcon, { iconType: "doNotInclude", iconSize: "16" }) })), _jsx("button", { className: addButtonClassName, onClick: handleAddClick, children: _jsx(GetSvgIcon, { iconType: "tick", iconSize: "16" }) })] })), showErrorMessage && (_jsxs("div", { className: "filterAddRemoveBadge--ErrorContainer", children: [_jsx(ClickableText, { colorVariant: "orange", sizeVariant: "xs", text: errorMessageText, onClick: onErrorMessageClick }), _jsx("button", { onClick: onCrossClick, type: "button", children: _jsx(GetSvgIcon, { iconType: "cross", iconSize: "20" }) })] }))] }));
};
export default FilterAddRemoveBadge;
