import { createContext, useContext } from "react";

export const RootContainerWidthContext = createContext<number | null>(null);

export const useRootContainerSize = () => {
  const rootContainerSize = useContext(RootContainerWidthContext);
  if (rootContainerSize === null) throw new Error("rootContainerSize context is null");

  return rootContainerSize;
};
