import { createContext, useContext, useMemo, PropsWithChildren } from 'react'; interface RowContextState { disableTrustOnFirstConnect: boolean; } const RowContext = createContext(null); export interface RowProviderProps { disableTrustOnFirstConnect: boolean; } export function RowProvider({ disableTrustOnFirstConnect, children, }: PropsWithChildren) { const state = useMemo( () => ({ disableTrustOnFirstConnect }), [disableTrustOnFirstConnect] ); return {children}; } export function useRowContext() { const context = useContext(RowContext); if (!context) { throw new Error('should be nested under RowProvider'); } return context; }