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