import React from 'react' type StateContext = boolean type ApiContext = (hasNew: boolean) => void const stateContext = React.createContext(false) stateContext.displayName = 'HomeBadgeStateContext' const apiContext = React.createContext((_: boolean) => {}) apiContext.displayName = 'HomeBadgeApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(false) return ( {children} ) } export function useHomeBadge() { return React.useContext(stateContext) } export function useSetHomeBadge() { return React.useContext(apiContext) }