import React from 'react';
import { isWalkInCustomer } from "../../selectors";
/**
 * 客户信息展示面板：原 SalesSdkDemoContent 内嵌实现的复用版。
 * 仅渲染 customer.selected；不消费写操作（select / loadList 仍由 step 触发）。
 */
export var CustomerPanel = function CustomerPanel(_ref) {
  var customer = _ref.customer;
  var selected = customer.selected;
  var displayName = (selected === null || selected === void 0 ? void 0 : selected.display_name) || (selected === null || selected === void 0 ? void 0 : selected.name) || [selected === null || selected === void 0 ? void 0 : selected.first_name, selected === null || selected === void 0 ? void 0 : selected.last_name].filter(Boolean).join(' ');
  return /*#__PURE__*/React.createElement("section", {
    className: "sales-sdk-demo__panel"
  }, /*#__PURE__*/React.createElement("div", {
    className: "sales-sdk-demo__section-title"
  }, /*#__PURE__*/React.createElement("h3", null, "Customer"), /*#__PURE__*/React.createElement("span", null, selected && isWalkInCustomer(selected) ? 'Walk-in' : 'Registered')), selected ? /*#__PURE__*/React.createElement("dl", {
    className: "sales-sdk-demo__detail-list"
  }, /*#__PURE__*/React.createElement("dt", null, "Name"), /*#__PURE__*/React.createElement("dd", null, displayName || '-'), /*#__PURE__*/React.createElement("dt", null, "Phone"), /*#__PURE__*/React.createElement("dd", null, [selected.country_calling_code, selected.phone].filter(Boolean).join(' ') || '-'), /*#__PURE__*/React.createElement("dt", null, "Email"), /*#__PURE__*/React.createElement("dd", null, selected.email || '-'), /*#__PURE__*/React.createElement("dt", null, "ID"), /*#__PURE__*/React.createElement("dd", null, String(selected.id))) : /*#__PURE__*/React.createElement("div", {
    className: "sales-sdk-demo__empty"
  }, "No customer selected."));
};