const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/eventBooking/components/OpenCard/index.tsx
const OpenCard = ({ children, title, className, scrollErrorId, initOpen = true, extra, isClick = true, showArrow = true, showBorder = false, showHeader = true }, ref) => {
	const [isOpen, setIsOpen] = (0, react.useState)(true);
	(0, react.useEffect)(() => {
		if (initOpen === false) setIsOpen(false);
	}, [initOpen]);
	(0, react.useImperativeHandle)(ref, () => {
		return { open: () => setIsOpen(true) };
	});
	return /* @__PURE__ */ React.createElement("div", {
		id: scrollErrorId,
		className: (0, classnames.default)("open-card", {
			open: isOpen,
			"open-card-border": showBorder
		}, className)
	}, showHeader ? /* @__PURE__ */ React.createElement("div", {
		className: "header",
		onClick: () => isClick ? setIsOpen(!isOpen) : null
	}, /* @__PURE__ */ React.createElement("div", { className: "title" }, title), /* @__PURE__ */ React.createElement("div", { className: "right" }, extra, showArrow ? /* @__PURE__ */ React.createElement(_pisell_materials.Iconfont, {
		type: !isOpen ? "pisell2-chevron-up" : "pisell2-chevron-down",
		className: (0, classnames.default)("icon")
	}) : null)) : null, children ? /* @__PURE__ */ React.createElement("div", { className: "content" }, children) : null);
};
var OpenCard_default = (0, react.forwardRef)(OpenCard);
//#endregion
exports.default = OpenCard_default;
