/** * @prettier */ import React from "react" import PropTypes from "prop-types" import ImPropTypes from "react-immutable-proptypes" const Callbacks = ({ callbacks, specPath, specSelectors, getComponent }) => { const operationDTOs = specSelectors.callbacksOperations({ callbacks, specPath, }) const callbackNames = Object.keys(operationDTOs) const OperationContainer = getComponent("OperationContainer", true) if (callbackNames.length === 0) return No callbacks return (
{callbackNames.map((callbackName) => (

{callbackName}

{operationDTOs[callbackName].map((operationDTO) => ( ))}
))}
) } Callbacks.propTypes = { getComponent: PropTypes.func.isRequired, specSelectors: PropTypes.shape({ callbacksOperations: PropTypes.func.isRequired, }).isRequired, callbacks: ImPropTypes.iterable.isRequired, specPath: ImPropTypes.list.isRequired, } export default Callbacks