import { PisellEntityCard } from "../pisellEntityCard/PisellEntityCard.js";
import React, { useMemo } from "react";
import "./PisellCustomerBrief.less";
//#region src/components/pisellCustomerBrief/PisellCustomerBrief.tsx
/**
* PisellCustomerBrief 客户简要卡片
* 基于 PisellEntityCard，用于展示客户（Customer）实体的核心识别信息与客户级属性。
* 设计文档：Customer Info (pcl_customerInfon_V1.0)
*
* - 无头像时显示默认占位 Avatar
* - 文本过长按配置省略
* - Actions 为空时不占位
*
* @param props 组件 Props
*/
function PisellCustomerBrief({ name, subtitle, avatar, email, address, company, date, extendedFields = [], tags = [], actions = [], showActions = false, showAvatar = true, showPrimaryText = true, showSubtitle = true, showExtended = true, showTags = true, density = "B2", layout = "horizontal", width = "content", swipeToDelete = false, onDelete, tagPosition = "below", contentGap, primaryLineClamp, secondaryLineClamp, renderMedia, renderPrimary, renderSubtitle, renderSecondary, renderTags, renderActions, className, style, hoverStyle, activeStyle, disabledStyle, clickable = true, disabled = false, onClick }) {
	/** 媒体区：头像，无 src 时 EntityCard 会显示默认占位 */
	const media = useMemo(() => {
		if (!showAvatar) return void 0;
		return {
			type: "avatar",
			src: avatar,
			alt: name,
			size: 40,
			shape: "circle"
		};
	}, [
		showAvatar,
		avatar,
		name
	]);
	/** 扩展信息 → 次级文案列表，顺序：email、address、company、date、extendedFields */
	const secondaryTexts = useMemo(() => {
		if (!showExtended) return [];
		const list = [];
		if (email) list.push({ text: email });
		if (address) list.push({ text: address });
		if (company) list.push({ text: company });
		if (date) list.push({ text: date });
		extendedFields.forEach((f) => list.push({
			text: f.text,
			showTooltip: f.showTooltip
		}));
		return list;
	}, [
		showExtended,
		email,
		address,
		company,
		date,
		extendedFields
	]);
	return /* @__PURE__ */ React.createElement(PisellEntityCard, {
		className: `pisell-customer-brief-root ${className !== null && className !== void 0 ? className : ""}`.trim(),
		style,
		hoverStyle,
		activeStyle,
		disabledStyle,
		clickable,
		disabled,
		onClick,
		media,
		primaryText: name,
		subtitleText: subtitle,
		secondaryTexts,
		tags,
		actions,
		showMedia: showAvatar,
		showPrimaryText,
		showSubtitle,
		showSecondaryText: showExtended,
		showTags,
		showActions,
		density,
		layout,
		width,
		swipeToDelete,
		onDelete,
		tagPosition,
		contentGap,
		primaryLineClamp,
		secondaryLineClamp,
		renderMedia,
		renderPrimary,
		renderSubtitle,
		renderSecondary,
		renderTags,
		renderActions
	});
}
//#endregion
export { PisellCustomerBrief };
