import React, { useContext, useState } from "react";

const StatusContext = React.createContext();

export const StatusProvider = ({ children }) => {
  const [message, setMessage] = useState(null);

  return (
    <StatusContext.Provider
      value={{
        message,
        setMessage,
      }}
    >
      {children}
    </StatusContext.Provider>
  );
};

export const useStatusContext = () => useContext(StatusContext);
