import React from 'react' type StateContext = boolean type SetContext = (v: boolean) => void const stateContext = React.createContext(false) stateContext.displayName = 'DrawerSwipeDisabledStateContext' const setContext = React.createContext((_: boolean) => {}) setContext.displayName = 'DrawerSwipeDisabledSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(false) return ( {children} ) } export function useIsDrawerSwipeDisabled() { return React.useContext(stateContext) } export function useSetDrawerSwipeDisabled() { return React.useContext(setContext) }