const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_index = require("../../../clientCard/index.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);
require("./index.less");
//#region src/plus/saleDetail/components/Client/index.tsx
function Client({ dataSource, className }) {
	const customer = (0, react.useMemo)(() => {
		if (!dataSource) return void 0;
		const displayName = dataSource.display_name || dataSource.name || [dataSource.first_name, dataSource.last_name].filter(Boolean).join(" ");
		return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, dataSource), {}, {
			customer_id: dataSource.id,
			name: dataSource.name || displayName,
			display_name: displayName,
			nickname: dataSource.nickname || displayName
		});
	}, [dataSource]);
	const dropdownProps = (0, react.useMemo)(() => ({ buttonProps: {
		icon: /* @__PURE__ */ react.default.createElement("span", { className: "pisell-sale-detail-client__switch-icon" }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
			type: "pisell2-switch-horizontal-01",
			size: 24
		})),
		size: "default",
		onClick: () => {},
		style: { display: "none" }
	} }), []);
	return /* @__PURE__ */ react.default.createElement("section", { className: (0, classnames.default)("pisell-sale-detail-client", className) }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-sale-detail-client__line" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-sale-detail-client__card-wrap" }, /* @__PURE__ */ react.default.createElement(require_index.default, {
		dataSource: customer,
		onAddClient: () => {},
		onChangeClient: () => {},
		onRemoveClient: () => {},
		onViewClient: () => {},
		style: {
			border: "solid",
			borderColor: "#D0D5DD",
			borderWidth: "1px",
			display: "flex",
			boxSizing: "border-box",
			height: "auto"
		},
		isShowAvatar: false,
		dropdown: dropdownProps
	}))));
}
//#endregion
exports.Client = Client;
