/**
 * venueBooking 定金协议组件
 * 复用 appointmentBooking/deposit 作为渲染引擎，适配 venueBooking 的数据形状：
 *   - deposit_policy_data（场地预订）→ protocols（appointmentBooking 期望字段）
 *   - venueBookingModule.getProtocol(id) → depositProtocolRequest
 */
import React from 'react';
import AppointmentDeposit from "../../../appointmentBooking/deposit";
import "../../../appointmentBooking/deposit/index.less";
export default function VenueDeposit(_ref) {
  var deposit = _ref.deposit,
    isAgreePolicy = _ref.isAgreePolicy,
    onChange = _ref.onChange,
    getProtocol = _ref.getProtocol;
  if (!(deposit !== null && deposit !== void 0 && deposit.hasDeposit)) return null;

  // deposit_policy_data 与 AppointmentDeposit 期望的 protocols 形状相同（{id, title}），直接复用
  var protocols = (deposit === null || deposit === void 0 ? void 0 : deposit.deposit_policy_data) || [];
  return /*#__PURE__*/React.createElement(AppointmentDeposit, {
    total: deposit === null || deposit === void 0 ? void 0 : deposit.total,
    protocols: protocols,
    isAgreePolicy: isAgreePolicy,
    isShowTitle: false,
    onChange: onChange,
    depositProtocolRequest: function depositProtocolRequest(id) {
      return getProtocol(id);
    }
  });
}