()
| 34 | ); |
| 35 | |
| 36 | export const usePaymentContext = (): PaymentContextData => { |
| 37 | const context = useContext(PaymentContext); |
| 38 | if (context === undefined) { |
| 39 | throw new Error( |
| 40 | 'usePaymentContext must be used within a PaymentContextProvider', |
| 41 | ); |
| 42 | } |
| 43 | return context; |
| 44 | }; |
| 45 | |
| 46 | export interface PaymentContextProviderProps<T = unknown, E = unknown> { |
| 47 | children?: ReactNode; |
no outgoing calls
no test coverage detected