import styled from '@emotion/styled'; import {ExportProfileButton} from 'sentry/components/profiling/exportProfileButton'; import {t} from 'sentry/locale'; import {Flamegraph} from 'sentry/utils/profiling/flamegraph'; import {useParams} from 'sentry/utils/useParams'; interface FlamegraphWarningProps { flamegraph: Flamegraph; } export function FlamegraphWarnings(props: FlamegraphWarningProps) { const params = useParams(); // A profile may be empty while we are fetching it from the network; while that is happening an empty profile is // passed down to the view so that all the components can be loaded and initialized ahead of time. if (props.flamegraph.profile.isEmpty()) { return null; } if (props.flamegraph.profile.samples.length === 0) { return (

{t( 'This profile either has no samples or the total duration of frames in the profile is 0.' )}

{t('Export Raw Profile')}
); } return null; } const Overlay = styled('div')` position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: grid; grid: auto/50%; place-content: center; z-index: ${p => p.theme.zIndex.initial}; text-align: center; `;