import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__MenuAdd_mjs__ from "./MenuAdd.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__MenuSearchAdd_style_mjs__ from "./MenuSearchAdd.style.mjs";
const MenuSearchAdd = (props)=>{
    const { designable, dn, setSearchMenuTitle } = props;
    const { t } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useTranslation)();
    const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__MenuSearchAdd_style_mjs__.useStyles)();
    const handleChange = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].debounce((event)=>{
        event.stopPropagation();
        const searchValue = event.target.value.trim();
        setSearchMenuTitle(searchValue);
    }, 500);
    const handleSearch = (value, event)=>{
        event.stopPropagation();
        __WEBPACK_EXTERNAL_MODULE_lodash__["default"].debounce(setSearchMenuTitle, 500)(value.trim());
    };
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
        className: styles.menuSearchAdd,
        children: [
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Input.Search, {
                allowClear: true,
                placeholder: t('search Menu'),
                prefix: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.Icon, {
                    type: "SearchOutlined"
                }),
                onChange: handleChange,
                onSearch: handleSearch
            }),
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                className: "menu-add-wrapper",
                children: designable && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__MenuAdd_mjs__.MenuAdd, {
                    dn: dn
                })
            })
        ]
    });
};
export { MenuSearchAdd };
