import { Search } from "@sofa-design/icons";
import { Input } from "antd";
import classNames from "clsx";
import React, { useRef } from "react";
/**
 * 文件搜索输入框：受控关键词，自带 allowClear
 */ var SearchInputComponent = function SearchInputComponent(param) {
    var keyword = param.keyword, onChange = param.onChange, searchPlaceholder = param.searchPlaceholder, prefixCls = param.prefixCls, hashId = param.hashId, locale = param.locale;
    var inputRef = useRef(null);
    return /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-search"), hashId)
    }, /*#__PURE__*/ React.createElement(Input, {
        ref: inputRef,
        key: "file-search-input",
        allowClear: true,
        placeholder: searchPlaceholder || (locale === null || locale === void 0 ? void 0 : locale['workspace.searchPlaceholder']) || '搜索文件名',
        prefix: /*#__PURE__*/ React.createElement(Search, null),
        value: keyword !== null && keyword !== void 0 ? keyword : '',
        onChange: function onChange1(e) {
            return onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
        }
    }));
};
SearchInputComponent.displayName = 'SearchInput';
export var SearchInput = /*#__PURE__*/ React.memo(SearchInputComponent);
