import React from 'react';
import { PisellText, Icon } from '@pisell/materials';
import "./index.less";
import { getAvailableMaxAmount } from "../../../utils";
var iconMaps = {
  // 代金券
  product_voucher: "pisell2-daijinquan",
  // 积分卡
  point_card: "pisell2-jifenka",
  // 充值卡
  gift_card: "pisell2-chongzhika",
  customer_wallet: "pisell2-qianbao"
};
var WalletUseList = function WalletUseList(props) {
  var _props$walletPass = props.walletPass,
    walletPass = _props$walletPass === void 0 ? [] : _props$walletPass;
  return /*#__PURE__*/React.createElement("div", {
    className: "toc-pay-wallet-use-list"
  }, walletPass.map(function (item) {
    return /*#__PURE__*/React.createElement("div", {
      className: "toc-pay-wallet-use-list-item"
    }, /*#__PURE__*/React.createElement("span", {
      className: "toc-pay-wallet-use-list-item-name"
    }, /*#__PURE__*/React.createElement(Icon, {
      type: iconMaps[item.tag] || "pisell2-daijinquan",
      className: "toc-pay-wallet-use-list-item-icon"
    }), item.product_name), /*#__PURE__*/React.createElement("span", {
      className: "toc-pay-wallet-use-list-item-amount"
    }, "-", /*#__PURE__*/React.createElement(PisellText.Amount, {
      value: getAvailableMaxAmount(item)
    })));
  }));
};
export default WalletUseList;