import TracePageSearchBar from '@jaegertracing/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar'; import { TopOfViewRefType } from '@jaegertracing/jaeger-ui-components/src/TraceTimelineViewer/VirtualizedTraceView'; import React, { RefObject, useMemo, useState } from 'react'; import { useSelector } from 'react-redux'; import { DataFrame, SplitOpen, PanelData } from '@grafana/data'; import { Collapse } from '@grafana/ui'; import { StoreState } from 'app/types'; import { ExploreId } from 'app/types/explore'; import { TraceView } from './TraceView'; import { useSearch } from './useSearch'; import { transformDataFrames } from './utils/transform'; interface Props { dataFrames: DataFrame[]; splitOpenFn: SplitOpen; exploreId: ExploreId; scrollElement?: Element; queryResponse: PanelData; topOfViewRef: RefObject; } export function TraceViewContainer(props: Props) { // At this point we only show single trace const frame = props.dataFrames[0]; const { dataFrames, splitOpenFn, exploreId, scrollElement, topOfViewRef, queryResponse } = props; const traceProp = useMemo(() => transformDataFrames(frame), [frame]); const { search, setSearch, spanFindMatches } = useSearch(traceProp?.spans); const [focusedSpanIdForSearch, setFocusedSpanIdForSearch] = useState(''); const [searchBarSuffix, setSearchBarSuffix] = useState(''); const datasource = useSelector( (state: StoreState) => state.explore[props.exploreId!]?.datasourceInstance ?? undefined ); if (!traceProp) { return null; } return ( <> ); }