import React, { memo } from 'react';
import classNames from 'classnames';
var PREFIX = 'payment-result-toast-v2';
/** 成功/部分支付的对勾图标。 */
function SuccessIcon() {
  return /*#__PURE__*/React.createElement("svg", {
    viewBox: "0 0 20 20",
    width: "20",
    height: "20",
    "aria-hidden": "true"
  }, /*#__PURE__*/React.createElement("circle", {
    cx: "10",
    cy: "10",
    r: "9",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M6.2 10.2 8.8 12.8 13.9 7.4",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.75",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  }));
}

/** 失败状态的告警图标。 */
function FailedIcon() {
  return /*#__PURE__*/React.createElement("svg", {
    viewBox: "0 0 20 20",
    width: "20",
    height: "20",
    "aria-hidden": "true"
  }, /*#__PURE__*/React.createElement("circle", {
    cx: "10",
    cy: "10",
    r: "9",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M10 6v5",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.75",
    strokeLinecap: "round"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "10",
    cy: "14",
    r: "0.9",
    fill: "currentColor"
  }));
}

/**
 * Toast 顶部 Hero 区：状态图标 + 主标题 + 副信息（找零 / 失败原因）。
 */
export var Hero = /*#__PURE__*/memo(function Hero(_ref) {
  var status = _ref.status,
    tone = _ref.tone,
    headline = _ref.headline,
    changeDueText = _ref.changeDueText,
    failureReason = _ref.failureReason;
  var isFailed = status === 'failed' || status === 'wallet-pass-failed';
  return /*#__PURE__*/React.createElement("div", {
    className: classNames("".concat(PREFIX, "__hero"), "".concat(PREFIX, "__hero--").concat(tone))
  }, /*#__PURE__*/React.createElement("span", {
    className: "".concat(PREFIX, "__hero-check"),
    "aria-hidden": "true"
  }, isFailed ? /*#__PURE__*/React.createElement(FailedIcon, null) : /*#__PURE__*/React.createElement(SuccessIcon, null)), /*#__PURE__*/React.createElement("span", {
    className: "".concat(PREFIX, "__hero-copy")
  }, /*#__PURE__*/React.createElement("span", {
    className: "".concat(PREFIX, "__hero-status")
  }, headline), changeDueText ? /*#__PURE__*/React.createElement("span", {
    className: "".concat(PREFIX, "__hero-change")
  }, changeDueText) : null, failureReason ? /*#__PURE__*/React.createElement("span", {
    className: "".concat(PREFIX, "__hero-reason")
  }, failureReason) : null));
});
Hero.displayName = 'PaymentResultToastV2Hero';
export default Hero;