const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_utils = require("../../utils.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
let _pisell_icon_es_User01 = require("@pisell/icon/es/User01");
_pisell_icon_es_User01 = require_runtime.__toESM(_pisell_icon_es_User01);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/booking/deposit/ClientItem/index.tsx
const ClientItem = (props) => {
	const { data, coverSize = 48, style, className, walkInName } = props;
	const getNickname = (0, react.useCallback)((item) => {
		if (require_utils.isWalkIn(item === null || item === void 0 ? void 0 : item.id)) return walkInName || _pisell_utils.locales.getText("pisell2.text.select-a-customer");
		return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
	}, [_pisell_utils.locales.localeMap]);
	return /* @__PURE__ */ react.default.createElement("div", {
		style,
		className: (0, classnames.default)("pisell-lowcode__client-item", className)
	}, /* @__PURE__ */ react.default.createElement(antd.Avatar, {
		className: "pisell-lowcode__client-item-avatar",
		src: _pisell_utils.image.ali(data === null || data === void 0 ? void 0 : data.cover, 100) || void 0,
		size: coverSize,
		icon: /* @__PURE__ */ react.default.createElement(_pisell_icon_es_User01.default, { className: "pisell-lowcode__client-item-avatar-icon" })
	}), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__client-item-info" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__client-item-info-name" }, getNickname(data)), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__client-item-info-desc" }, (data === null || data === void 0 ? void 0 : data.email) ? /* @__PURE__ */ react.default.createElement("div", { className: "" }, data === null || data === void 0 ? void 0 : data.email) : null, (data === null || data === void 0 ? void 0 : data.phone) ? /* @__PURE__ */ react.default.createElement("div", { className: "" }, data === null || data === void 0 ? void 0 : data.phone) : null)));
};
//#endregion
exports.default = ClientItem;
