const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let styled_components = require("styled-components");
styled_components = require_runtime.__toESM(styled_components);
require("./index.less");
//#region src/components/collapse/index.tsx
const _excluded = [
	"panelBackground",
	"panelMarginBottom",
	"panelBorderRadius",
	"items",
	"showHeader",
	"headerColor",
	"headerFontSize",
	"expandIcon"
];
const CustomCollapse = (0, styled_components.default)(antd.Collapse)`
  &.custom-collapse {
    background-color: ${(props) => props.panelBackground || "#ffffff"};
  }

  // .ant-collapse-item {
  //   background-color: ${(props) => props.panelBackground || "#ffffff"};
  //   margin-bottom: ${(props) => props.panelMarginBottom || "0"};
  //   border-radius: ${(props) => props.panelBorderRadius || "0"};
  // }

  // .pisell-lowcode-collapse-header {
  //   background-color: ${(props) => props.panelBackground || "#ffffff"};
  //   border-radius: ${(props) => props.panelBorderRadius || "0"} !important;
  // }

  .pisell-lowcode-collapse-content {
    background-color: ${(props) => props.panelBackground || "#ffffff"};
  }
`;
const Collapse = (props) => {
	const { panelBackground, panelMarginBottom, panelBorderRadius, items, showHeader, headerColor, headerFontSize, expandIcon } = props, rest = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
	/**
	* @title: 面板内容
	* @description:
	* @param {*} CollapseProps
	* @return {*}
	* @Author: WangHan
	* @Date: 2024-11-25 20:28
	*/
	const itemsMap = (0, react.useMemo)(() => {
		return items === null || items === void 0 ? void 0 : items.map((item) => {
			return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, {
				label: showHeader ? /* @__PURE__ */ react.default.createElement("div", { style: {
					color: headerColor,
					fontSize: headerFontSize
				} }, item === null || item === void 0 ? void 0 : item.label) : null,
				children: item.children,
				className: "custom-collapse-panel"
			});
		});
	}, [
		items,
		headerColor,
		showHeader,
		headerFontSize
	]);
	return /* @__PURE__ */ react.default.createElement(CustomCollapse, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, rest), {}, {
		expandIcon: expandIcon ? () => expandIcon : void 0,
		items: itemsMap,
		className: "custom-collapse",
		panelBackground,
		panelMarginBottom,
		panelBorderRadius
	}));
};
Collapse.Panel = antd.Collapse.Panel;
//#endregion
exports.default = Collapse;
