import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import ClientCard from "../../../clientCard/index.js";
import React, { useMemo } from "react";
import { Iconfont } from "@pisell/materials";
import classNames from "classnames";
import "./index.less";
//#region src/plus/saleDetail/components/Client/index.tsx
function Client({ dataSource, className }) {
	const customer = useMemo(() => {
		if (!dataSource) return void 0;
		const displayName = dataSource.display_name || dataSource.name || [dataSource.first_name, dataSource.last_name].filter(Boolean).join(" ");
		return _objectSpread2(_objectSpread2({}, dataSource), {}, {
			customer_id: dataSource.id,
			name: dataSource.name || displayName,
			display_name: displayName,
			nickname: dataSource.nickname || displayName
		});
	}, [dataSource]);
	const dropdownProps = useMemo(() => ({ buttonProps: {
		icon: /* @__PURE__ */ React.createElement("span", { className: "pisell-sale-detail-client__switch-icon" }, /* @__PURE__ */ React.createElement(Iconfont, {
			type: "pisell2-switch-horizontal-01",
			size: 24
		})),
		size: "default",
		onClick: () => {},
		style: { display: "none" }
	} }), []);
	return /* @__PURE__ */ React.createElement("section", { className: classNames("pisell-sale-detail-client", className) }, /* @__PURE__ */ React.createElement("div", { className: "pisell-sale-detail-client__line" }, /* @__PURE__ */ React.createElement("div", { className: "pisell-sale-detail-client__card-wrap" }, /* @__PURE__ */ React.createElement(ClientCard, {
		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
export { Client };
