import { createContext, useState } from "react";
const MessagesContext = createContext();

export const useMessagesContext = () => {
  const [roomID, setRoomID] = useState("");
  const [courseID, setCourseID] = useState("");
  const [userID, setUserID] = useState("");
  const [receiverID, setReceiverID] = useState("");
  const [userChatList, setUserChatList] = useState([]);
  const [friendRooms, setFriendRooms] = useState(true);
  const affiliates = localStorage?.getItem("affiliates");


  return {
    roomID,
    setRoomID,
    userID,
    setUserID,
    userChatList,
    setUserChatList,
    courseID,
    setCourseID,
    receiverID,
    setReceiverID,
    friendRooms,
    setFriendRooms,
    affiliates
  };
};

export default MessagesContext;
