import React, { createContext } from "react";

import MessagesContext, { useMessagesContext } from "../hooks/messagesContext";
import Messages from "./messages";

const MessagesAddon = ({
  close,
  user,
  userFullName,
  userType,
  courseName,
  roomID,
  setRoomID,
  userID,
  setUserID,
  userAvatar,
  courseID,
  setCourseID,
  receiverID,
  setReceiverID,
  accountType,
  affiliates,
  enterpriseAffiliateID
}) => {
  const messagesContextData = useMessagesContext();

  return (
    <MessagesContext.Provider value={messagesContextData}>
      <Messages
        close={close}
        user={user}
        userFullName={userFullName}
        userType={userType}
        courseName={courseName}
        roomID={roomID}
        setRoomID={setRoomID}
        userID={userID}
        setUserID={setUserID}
        userAvatar={userAvatar}
        courseID={courseID}
        setCourseID={setCourseID}
        receiverID={receiverID}
        setReceiverID={setReceiverID}
        accountType={accountType}
        affiliates={affiliates}
        enterpriseAffiliateID={enterpriseAffiliateID}
      />
    </MessagesContext.Provider>
  );
};
export default MessagesAddon;
