import React from "react";
import { Form } from "antd";
import SchedulesModule from "./SchedulesModule";
import MaxParticipantsModule from "./MaxParticipantsModule";
import ResourcesModule from "./ResourcesModule";
import "./index.less";
var ProductDetail = function ProductDetail(_ref) {
  var form = _ref.form,
    currentProduct = _ref.currentProduct;
  var useSchedule = Form.useWatch("schedule", form);
  var isAutoChange = Form.useWatch("isAutoChange", form);
  return /*#__PURE__*/React.createElement("div", {
    className: "product-detail-card"
  }, /*#__PURE__*/React.createElement(Form.Item, {
    noStyle: true,
    name: "schedule"
  }, /*#__PURE__*/React.createElement(SchedulesModule, {
    tabKey: "products",
    onChange: function onChange() {
      form.setFieldsValue({
        isAutoChange: true
      });
    }
  })), /*#__PURE__*/React.createElement(Form.Item, {
    noStyle: true,
    name: "max_participants"
  }, /*#__PURE__*/React.createElement(MaxParticipantsModule, {
    form: form,
    useSchedule: useSchedule,
    isAutoChange: isAutoChange
  })), /*#__PURE__*/React.createElement(Form.Item, {
    hidden: true,
    name: "isAutoChange",
    initialValue: false
  }, /*#__PURE__*/React.createElement("switch", null)), /*#__PURE__*/React.createElement(ResourcesModule, {
    product: currentProduct
  }));
};
export default ProductDetail;