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");
const require_mock = require("../../mock.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
let src_components_eventBooking_assets_image_svg = require("../../assets/image.svg");
src_components_eventBooking_assets_image_svg = require_runtime.__toESM(src_components_eventBooking_assets_image_svg);
let src_components_eventBooking_assets_calendar_heart_svg = require("../../assets/calendar-heart.svg");
src_components_eventBooking_assets_calendar_heart_svg = require_runtime.__toESM(src_components_eventBooking_assets_calendar_heart_svg);
let src_components_eventBooking_assets_compass_svg = require("../../assets/compass.svg");
src_components_eventBooking_assets_compass_svg = require_runtime.__toESM(src_components_eventBooking_assets_compass_svg);
let src_components_eventBooking_assets_phone_svg = require("../../assets/phone.svg");
src_components_eventBooking_assets_phone_svg = require_runtime.__toESM(src_components_eventBooking_assets_phone_svg);
require("./index.less");
//#region src/components/eventBooking/components/resourceDisplay/index.tsx
const _excluded = [
	"dataSource",
	"mode",
	"showImage",
	"showTitle",
	"showSubtitle",
	"showLocation",
	"showContact",
	"direction",
	"shape",
	"size",
	"useTextAvatar",
	"className",
	"style",
	"onClick"
];
const PisellResourceCard = (_ref) => {
	let { dataSource, mode = "normal", showImage = true, showTitle = true, showSubtitle = true, showLocation = true, showContact = true, direction = "horizontal", shape = "circle", size = "xxl", useTextAvatar = false, className, style, onClick } = _ref, rest = require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded);
	const { resource_display } = require_mock.mock;
	const { image, title, subtitle, location, contact } = dataSource || resource_display;
	/**
	* @title: 渲染头像
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-09 20:57
	*/
	const renderAvatar = () => {
		if (!showImage) return null;
		return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellAvatar, {
			src: image || void 0,
			shape,
			size,
			useTextAvatar: !image,
			children: (rest === null || rest === void 0 ? void 0 : rest.children) || /* @__PURE__ */ react.default.createElement(_pisell_materials.Image, {
				src: src_components_eventBooking_assets_image_svg.default,
				preview: false
			}),
			className: (0, classnames.default)({
				"pisell-resource-card-campus-avatar": mode === "campus",
				"pisell-resource-card-empty-avatar": !image
			})
		});
	};
	/**
	* @title: 校区列表
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-09 21:22
	*/
	const campusLists = () => {
		let lists = [];
		if (showTitle && title) lists.push({
			key: "title",
			value: title,
			icon: src_components_eventBooking_assets_calendar_heart_svg.default
		});
		if (showLocation && location) lists.push({
			key: "location",
			value: location,
			icon: src_components_eventBooking_assets_compass_svg.default
		});
		if (showContact && contact) lists.push({
			key: "contact",
			value: contact,
			icon: src_components_eventBooking_assets_phone_svg.default
		});
		return lists;
	};
	/**
	* @title: 渲染内容
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-09 21:02
	*/
	const renderContent = () => {
		if (mode !== "campus") return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, showTitle && title && /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText, { className: "pisell-resource-card-name" }, title), showSubtitle && subtitle && /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText, { className: "pisell-resource-card-subtitle" }, subtitle));
		return /* @__PURE__ */ react.default.createElement("div", { className: "pisell-resource-card-campus-wrap" }, campusLists().map(({ key, value, icon }) => {
			return /* @__PURE__ */ react.default.createElement("div", {
				className: "pisell-resource-card-campus-item",
				key
			}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Image, {
				src: icon,
				preview: false
			}), /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellText, null, value));
		}));
	};
	return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellCard, require_objectSpread2._objectSpread2({
		className: (0, classnames.default)("pisell-resource-card", `pisell-resource-card-${direction}`, className),
		style,
		onClick
	}, rest), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-resource-card-content" }, renderAvatar(), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-resource-card-info" }, renderContent())));
};
//#endregion
exports.default = PisellResourceCard;
