import { useState , useEffect } from 'react' ; import { ChromeStart } from 'kibana/public' ; export const useChromeVisibility = ( chrome ) => { const [ isVisible , setIsVisible ] = useState < boolean > ( ) ; useEffect ( ( ) => { const subscription = chrome . getIsVisible$ ( ) . subscribe ( ( value ) => { setIsVisible ( value ) ; } ) ; return ( ) => subscription . unsubscribe ( ) ; } , [ chrome ] ) ; return isVisible ; } ;