import React, { createContext, useContext, FC } from 'react' import { SummaryProps } from './Summary' const SummaryContext = createContext(undefined) export const useSummary = () => { const context = useContext(SummaryContext) if (context === undefined) { throw new Error('useSummary must be used within a SummaryProvider') } return context } export const SummaryContextProvider: FC = ({ coupon, insertCoupon, loading, totalizers, total, children, }) => ( {children} )