'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React from 'react';
import { XIcon } from '../../../icons/X/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { Tooltip } from '../../Tooltip/index.js';
import './index.scss';
const baseClass = 'multi-value-remove';
export const MultiValueRemove = (props)=>{
    const { innerProps: { className, onClick, onTouchEnd } } = props;
    const [showTooltip, setShowTooltip] = React.useState(false);
    const { t } = useTranslation();
    return /*#__PURE__*/ _jsxDEV("button", {
        "aria-label": t('general:remove'),
        className: [
            baseClass,
            className
        ].filter(Boolean).join(' '),
        onClick: (e)=>{
            setShowTooltip(false);
            onClick(e);
        },
        onKeyDown: (e)=>{
            if (e.key === 'Enter') {
                e.stopPropagation();
            }
        },
        onMouseDown: (e)=>e.stopPropagation(),
        onMouseEnter: ()=>setShowTooltip(true),
        onMouseLeave: ()=>setShowTooltip(false),
        onTouchEnd: onTouchEnd,
        type: "button",
        children: [
            /*#__PURE__*/ _jsxDEV(Tooltip, {
                className: `${baseClass}__tooltip`,
                show: showTooltip,
                children: t('general:remove')
            }, void 0, false, {
                fileName: "src/elements/ReactSelect/MultiValueRemove/index.tsx",
                lineNumber: 46,
                columnNumber: 7
            }, this),
            /*#__PURE__*/ _jsxDEV(XIcon, {
                className: `${baseClass}__icon`
            }, void 0, false, {
                fileName: "src/elements/ReactSelect/MultiValueRemove/index.tsx",
                lineNumber: 49,
                columnNumber: 7
            }, this)
        ]
    }, void 0, true, {
        fileName: "src/elements/ReactSelect/MultiValueRemove/index.tsx",
        lineNumber: 28,
        columnNumber: 5
    }, this);
};

//# sourceMappingURL=index.js.map