mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
17 lines
629 B
TypeScript
17 lines
629 B
TypeScript
import { isTruthy } from '@grafana/data';
|
|
import { Branding } from 'app/core/components/Branding/Branding';
|
|
import { useNavModel } from 'app/core/hooks/useNavModel';
|
|
import { useSelector } from 'app/types';
|
|
|
|
import { selectOrderedExplorePanes } from '../state/selectors';
|
|
|
|
export function useExplorePageTitle() {
|
|
const navModel = useNavModel('explore');
|
|
|
|
const datasourceNames = useSelector((state) =>
|
|
Object.values(selectOrderedExplorePanes(state)).map((pane) => pane?.datasourceInstance?.name)
|
|
).filter(isTruthy);
|
|
|
|
document.title = `${navModel.main.text} - ${datasourceNames.join(' | ')} - ${Branding.AppTitle}`;
|
|
}
|