const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../../../hooks/useEngineContext.js");
const require_hooks = require("../../hooks.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_materials = require("@pisell/materials");
let _ant_design_icons = require("@ant-design/icons");
require("./index.less");
//#region src/components/ecocup/components/PageHeader/index.tsx
const prefixCls = "ecocup-page-header";
const CustomPageHeader = (props) => {
	var _context$appHelper;
	const { title, rightContent, isReturn = true } = props;
	const context = require_useEngineContext.default();
	const { history } = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
	const app = require_hooks.useGetApp();
	const onBack = () => {
		if (!isReturn) return;
		if (app === null || app === void 0 ? void 0 : app.history) {
			var _app$history;
			(_app$history = app.history) === null || _app$history === void 0 || _app$history.goBack();
		} else {
			var _history$goBack;
			history === null || history === void 0 || (_history$goBack = history.goBack) === null || _history$goBack === void 0 || _history$goBack.call(history);
		}
	};
	return /* @__PURE__ */ react.default.createElement("div", {
		className: prefixCls,
		onClick: onBack
	}, /* @__PURE__ */ react.default.createElement("div", { className: `${prefixCls}-left-container` }, isReturn ? /* @__PURE__ */ react.default.createElement(_ant_design_icons.LeftOutlined, { style: { fontSize: 18 } }) : null, /* @__PURE__ */ react.default.createElement(_pisell_materials.PageHeader, {
		title,
		showTitle: true
	})), /* @__PURE__ */ react.default.createElement("div", {
		className: `${prefixCls}-right-container`,
		onClick: (e) => e.stopPropagation()
	}, rightContent || ""));
};
//#endregion
exports.default = CustomPageHeader;
