import Dropdown$1 from "../dropdown/index.js";
import React from "react";
import { Menu } from "antd";
import classNames from "classnames";
import "./index.less";
//#region src/components/pisellDropdown/index.tsx
const PisellDropdown = ({ trigger, items = [], showShortcut = true, triggerType = ["click"], className, style, onSelect }) => {
	const renderMenuItem = (item) => {
		const menuItem = /* @__PURE__ */ React.createElement("div", { className: "pisell-dropdown-item" }, /* @__PURE__ */ React.createElement("div", { className: "pisell-dropdown-item-content" }, item.icon && /* @__PURE__ */ React.createElement("span", { className: "pisell-dropdown-item-icon" }, item.icon), /* @__PURE__ */ React.createElement("span", { className: "pisell-dropdown-item-label" }, item.label)), showShortcut && item.shortcut && /* @__PURE__ */ React.createElement("span", { className: "pisell-dropdown-item-shortcut" }, item.shortcut));
		return item.divider ? /* @__PURE__ */ React.createElement(React.Fragment, { key: item.key }, /* @__PURE__ */ React.createElement(Menu.Item, { key: item.key }, menuItem), /* @__PURE__ */ React.createElement(Menu.Divider, null)) : /* @__PURE__ */ React.createElement(Menu.Item, { key: item.key }, menuItem);
	};
	const menu = /* @__PURE__ */ React.createElement(Menu, {
		onClick: ({ key }) => onSelect === null || onSelect === void 0 ? void 0 : onSelect(key),
		className: "pisell-dropdown-menu"
	}, items.map(renderMenuItem));
	return /* @__PURE__ */ React.createElement(Dropdown$1, {
		overlay: menu,
		trigger: triggerType,
		className: classNames("pisell-dropdown", className),
		style
	}, trigger || /* @__PURE__ */ React.createElement("span", null, "Account"));
};
//#endregion
export { PisellDropdown as default };
