const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../dropdown/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./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.default.createElement("div", { className: "pisell-dropdown-item" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-dropdown-item-content" }, item.icon && /* @__PURE__ */ react.default.createElement("span", { className: "pisell-dropdown-item-icon" }, item.icon), /* @__PURE__ */ react.default.createElement("span", { className: "pisell-dropdown-item-label" }, item.label)), showShortcut && item.shortcut && /* @__PURE__ */ react.default.createElement("span", { className: "pisell-dropdown-item-shortcut" }, item.shortcut));
		return item.divider ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, { key: item.key }, /* @__PURE__ */ react.default.createElement(antd.Menu.Item, { key: item.key }, menuItem), /* @__PURE__ */ react.default.createElement(antd.Menu.Divider, null)) : /* @__PURE__ */ react.default.createElement(antd.Menu.Item, { key: item.key }, menuItem);
	};
	const menu = /* @__PURE__ */ react.default.createElement(antd.Menu, {
		onClick: ({ key }) => onSelect === null || onSelect === void 0 ? void 0 : onSelect(key),
		className: "pisell-dropdown-menu"
	}, items.map(renderMenuItem));
	return /* @__PURE__ */ react.default.createElement(require_index.default, {
		overlay: menu,
		trigger: triggerType,
		className: (0, classnames.default)("pisell-dropdown", className),
		style
	}, trigger || /* @__PURE__ */ react.default.createElement("span", null, "Account"));
};
//#endregion
exports.default = PisellDropdown;
