import React__default from 'react';

// todo@v4.0.0: combine with the provider in core-ts, see:
const MessageContext = /*#__PURE__*/React__default.createContext(undefined);
const MessageProvider = props => {
  const {
    children,
    message,
    isByMe = false
  } = props;
  return /*#__PURE__*/React__default.createElement(MessageContext.Provider, {
    value: {
      message,
      isByMe
    }
  }, children);
};
const useMessageContext = () => {
  const value = React__default.useContext(MessageContext);
  if (value === undefined) {
    throw new Error('useMessageContext must be used within a MessageProvider');
  }
  return value;
};

export { MessageProvider, useMessageContext };
//# sourceMappingURL=context.js.map
