const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _ant_design_icons = require("@ant-design/icons");
//#region src/components/pisellLookup/components/SuggestWords.tsx
/**
* SuggestWords 组件
* 展示搜索联想词
*/
const SuggestWords = (props) => {
	const { suggestions, onSelect, render, className, style } = props;
	if (!suggestions || suggestions.length === 0) return null;
	if (render) return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, render(suggestions, onSelect));
	/**
	* 处理点击联想词
	*/
	const handleClick = (keyword) => {
		onSelect(keyword);
	};
	return /* @__PURE__ */ react.default.createElement("div", {
		className: `pisell-lookup-suggestions ${className || ""}`,
		style
	}, /* @__PURE__ */ react.default.createElement(antd.List, {
		className: "pisell-lookup-suggestions-list",
		size: "small",
		dataSource: suggestions,
		renderItem: (item) => /* @__PURE__ */ react.default.createElement(antd.List.Item, {
			className: "pisell-lookup-suggestions-item",
			onClick: () => handleClick(item)
		}, /* @__PURE__ */ react.default.createElement(_ant_design_icons.SearchOutlined, { style: {
			marginRight: 8,
			color: "#667085"
		} }), item)
	}));
};
SuggestWords.displayName = "SuggestWords";
//#endregion
exports.SuggestWords = SuggestWords;
