import { useContext } from "react" import { BookingFlowContext, type BookingFlowContextData, } from "../bookingFlowContext" export const useBookingFlowContext = (): BookingFlowContextData => { const context = useContext(BookingFlowContext) if (!context) { throw new Error( "useBookingFlowContext must be used within a BookingFlowContextProvider. Did you forget to use the provider in the consuming app?" ) } return context }