import { getText } from "../../../locales/index.js";
import React from "react";
//#region src/components/pisellLookup/components/HotWords.tsx
/**
* HotWords 组件
* 展示热门搜索
*/
const HotWords = (props) => {
	const { hotWords, onSelect, render, className, style } = props;
	if (!hotWords || hotWords.length === 0) return null;
	if (render) return /* @__PURE__ */ React.createElement(React.Fragment, null, render(hotWords, onSelect));
	/**
	* 处理点击热门搜索
	*/
	const handleClick = (keyword) => {
		onSelect(keyword);
	};
	return /* @__PURE__ */ React.createElement("div", {
		className: `pisell-lookup-hotwords ${className || ""}`,
		style
	}, /* @__PURE__ */ React.createElement("div", { className: "pisell-lookup-hotwords-title" }, getText("pisell-lookup-popular-search")), /* @__PURE__ */ React.createElement("div", { className: "pisell-lookup-hotwords-list" }, hotWords.map((item, index) => /* @__PURE__ */ React.createElement("div", {
		key: `${item}-${index}`,
		className: "pisell-lookup-hotwords-item",
		onClick: () => handleClick(item),
		title: item
	}, item))));
};
HotWords.displayName = "HotWords";
//#endregion
export { HotWords };
