import React , { createContext , ReactNode , useContext } from "react" ; type Metadata = { altFooter : boolean ; isBlogPost : boolean ; } ; type Props = Readonly < { children : ReactNode ; value ? : Metadata ; } > ; const metadata = { altFooter : false , isBlogPost : false , } ; const MetadataContext = createContext ( metadata ) ; const useMetadataContext = ( ) => useContext ( MetadataContext ) ; export const MetadataContextProvider = ( { children , value } ) => ( < MetadataContext . Provider value = { value ?? metadata } > { children } < /MetadataContext.Provider>); export default useMetadataContext ;