import { useContext } from "react"; import { CustomersContext, CustomersContextType } from "../context"; export const useCustomersContext = (): CustomersContextType => { const context = useContext(CustomersContext); if (!context) { throw new Error("useCustomers must be used within a CustomersProvider"); } return context; };