import { useService } from '@cloudbeaver/core-di' ; import { NavigationTabsService } from '../../NavigationTabsService' ; export function useTab ( tabId ) { const navigationTabs = useService ( NavigationTabsService ) ; const tab = navigationTabs . getTab ( tabId ) ; if ( ! tab ) { throw new Error ( `Tab ${ tabId } not found` ) ; } return tab ; }