import { useContext } from "react";
import { InvoicesContext } from "./invoices-context";

export const useInvoicesContext = () => {
  const context = useContext(InvoicesContext);
  if (context === null) throw new Error("useInvoices must be used within a InvoicesProvider");
  return context;
};
