import { css } from '@emotion/css'; import TracePageSearchBar from '@jaegertracing/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar'; import { TopOfViewRefType } from '@jaegertracing/jaeger-ui-components/src/TraceTimelineViewer/VirtualizedTraceView'; import React, { useMemo, useState, createRef } from 'react'; import { useAsync } from 'react-use'; import { PanelProps } from '@grafana/data'; import { getDataSourceSrv } from '@grafana/runtime'; import { TraceView } from 'app/features/explore/TraceView/TraceView'; import { useSearch } from 'app/features/explore/TraceView/useSearch'; import { transformDataFrames } from 'app/features/explore/TraceView/utils/transform'; const styles = { wrapper: css` height: 100%; overflow: scroll; `, }; export const TracesPanel: React.FunctionComponent = ({ data }) => { const topOfViewRef = createRef(); const traceProp = useMemo(() => transformDataFrames(data.series[0]), [data.series]); const { search, setSearch, spanFindMatches } = useSearch(traceProp?.spans); const [focusedSpanIdForSearch, setFocusedSpanIdForSearch] = useState(''); const [searchBarSuffix, setSearchBarSuffix] = useState(''); const dataSource = useAsync(async () => { return await getDataSourceSrv().get(data.request?.targets[0].datasource?.uid); }); const scrollElement = document.getElementsByClassName(styles.wrapper)[0]; if (!data || !data.series.length || !traceProp) { return (

No data found in response

); } return (
{data.series[0]?.meta?.preferredVisualisationType === 'trace' ? ( ) : null}
); };