import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import React, { useMemo } from "react";
import { Collapse } from "antd";
import styled from "styled-components";
import "./index.less";
//#region src/components/collapse/index.tsx
const _excluded = [
	"panelBackground",
	"panelMarginBottom",
	"panelBorderRadius",
	"items",
	"showHeader",
	"headerColor",
	"headerFontSize",
	"expandIcon"
];
const CustomCollapse = styled(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$1 = (props) => {
	const { panelBackground, panelMarginBottom, panelBorderRadius, items, showHeader, headerColor, headerFontSize, expandIcon } = props, rest = _objectWithoutProperties(props, _excluded);
	/**
	* @title: 面板内容
	* @description:
	* @param {*} CollapseProps
	* @return {*}
	* @Author: WangHan
	* @Date: 2024-11-25 20:28
	*/
	const itemsMap = useMemo(() => {
		return items === null || items === void 0 ? void 0 : items.map((item) => {
			return _objectSpread2(_objectSpread2({}, item), {}, {
				label: showHeader ? /* @__PURE__ */ React.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.createElement(CustomCollapse, _objectSpread2(_objectSpread2({}, rest), {}, {
		expandIcon: expandIcon ? () => expandIcon : void 0,
		items: itemsMap,
		className: "custom-collapse",
		panelBackground,
		panelMarginBottom,
		panelBorderRadius
	}));
};
Collapse$1.Panel = Collapse.Panel;
//#endregion
export { Collapse$1 as default };
