import React from "react";
import { List } from "antd";
import { SearchOutlined } from "@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.createElement(React.Fragment, null, render(suggestions, onSelect));
	/**
	* 处理点击联想词
	*/
	const handleClick = (keyword) => {
		onSelect(keyword);
	};
	return /* @__PURE__ */ React.createElement("div", {
		className: `pisell-lookup-suggestions ${className || ""}`,
		style
	}, /* @__PURE__ */ React.createElement(List, {
		className: "pisell-lookup-suggestions-list",
		size: "small",
		dataSource: suggestions,
		renderItem: (item) => /* @__PURE__ */ React.createElement(List.Item, {
			className: "pisell-lookup-suggestions-item",
			onClick: () => handleClick(item)
		}, /* @__PURE__ */ React.createElement(SearchOutlined, { style: {
			marginRight: 8,
			color: "#667085"
		} }), item)
	}));
};
SuggestWords.displayName = "SuggestWords";
//#endregion
export { SuggestWords };
