import React, { useContext, useState } from "react";

export const historyContext = React.createContext<any>({});

export const usePath = () => useContext(historyContext);

export const HistoryProvider = ({ children }: any) => {
  const [path, setpath] = useState(null);

  return (
    <historyContext.Provider value={{ path, setpath }}>
      {children}
    </historyContext.Provider>
  );
};
