profilingOnboardingPanel.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import styled from '@emotion/styled';
  2. import emptyStateImg from 'sentry-images/spot/performance-empty-state.svg';
  3. import ButtonBar from 'sentry/components/buttonBar';
  4. import OnboardingPanel from 'sentry/components/onboardingPanel';
  5. import {t} from 'sentry/locale';
  6. interface ProfilingOnboardingPanelProps {
  7. children: React.ReactNode;
  8. }
  9. export function ProfilingOnboardingPanel(props: ProfilingOnboardingPanelProps) {
  10. return (
  11. <OnboardingPanel image={<HeroImage src={emptyStateImg} />}>
  12. <h3>{t('Function level insights')}</h3>
  13. <p>
  14. {t(
  15. 'Discover slow-to-execute or resource intensive functions within your application'
  16. )}
  17. </p>
  18. <ButtonList gap={1}>{props.children}</ButtonList>
  19. </OnboardingPanel>
  20. );
  21. }
  22. const HeroImage = styled('img')`
  23. @media (min-width: ${p => p.theme.breakpoints.small}) {
  24. user-select: none;
  25. position: absolute;
  26. top: 0;
  27. bottom: 0;
  28. width: 220px;
  29. margin-top: auto;
  30. margin-bottom: auto;
  31. transform: translateX(-50%);
  32. left: 50%;
  33. }
  34. @media (min-width: ${p => p.theme.breakpoints.large}) {
  35. transform: translateX(-30%);
  36. width: 380px;
  37. min-width: 380px;
  38. }
  39. @media (min-width: ${p => p.theme.breakpoints.xlarge}) {
  40. transform: translateX(-30%);
  41. width: 420px;
  42. min-width: 420px;
  43. }
  44. `;
  45. const ButtonList = styled(ButtonBar)`
  46. grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
  47. `;