import React, { memo } from 'react';
import classNames from 'classnames';
import { locales } from '@pisell/utils';
var PREFIX = 'payment-result-toast-v2';
/**
 * “本次支付”明细区（对应 demo 的 session lines）。
 * 纯展示：现金/找零/EFTPOS/Voucher 等行由上层 builder 计算后传入。
 */
export var SessionLines = /*#__PURE__*/memo(function SessionLines(_ref) {
  var lines = _ref.lines;
  if (!lines || lines.length === 0) {
    return null;
  }
  return /*#__PURE__*/React.createElement("section", {
    className: "".concat(PREFIX, "__session"),
    "aria-label": String(locales.getText('payment.result.this-payment'))
  }, /*#__PURE__*/React.createElement("dl", {
    className: "".concat(PREFIX, "__session-lines")
  }, lines.map(function (line) {
    return /*#__PURE__*/React.createElement("div", {
      key: line.id,
      className: classNames("".concat(PREFIX, "__session-line"), {
        'is-nested': line.nested,
        'is-change': line.tone === 'change',
        'is-balance': line.tone === 'balance'
      })
    }, /*#__PURE__*/React.createElement("dt", null, line.label), /*#__PURE__*/React.createElement("dd", null, line.amount));
  })));
});
SessionLines.displayName = 'PaymentResultToastV2SessionLines';
export default SessionLines;