samplingPromo.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import styled from '@emotion/styled';
  2. import onboardingServerSideSampling from 'sentry-images/spot/onboarding-server-side-sampling.svg';
  3. import Button from 'sentry/components/button';
  4. import ButtonBar from 'sentry/components/buttonBar';
  5. import OnboardingPanel from 'sentry/components/onboardingPanel';
  6. import {t} from 'sentry/locale';
  7. import {SERVER_SIDE_SAMPLING_DOC_LINK} from './utils';
  8. type Props = {
  9. hasAccess: boolean;
  10. onGetStarted: () => void;
  11. onReadDocs: () => void;
  12. };
  13. export function SamplingPromo({onGetStarted, onReadDocs, hasAccess}: Props) {
  14. return (
  15. <OnboardingPanel image={<img src={onboardingServerSideSampling} />}>
  16. <h3>{t('Sample for relevancy')}</h3>
  17. <Paragraph>
  18. {t(
  19. 'Create rules to sample transactions under specific conditions, keeping what you need and dropping what you don’t.'
  20. )}
  21. </Paragraph>
  22. <ButtonList gap={1}>
  23. <Button
  24. priority="primary"
  25. onClick={onGetStarted}
  26. disabled={!hasAccess}
  27. title={hasAccess ? undefined : t('You do not have permission to set up rules')}
  28. >
  29. {t('Start Setup')}
  30. </Button>
  31. <Button href={SERVER_SIDE_SAMPLING_DOC_LINK} onClick={onReadDocs} external>
  32. {t('Read Docs')}
  33. </Button>
  34. </ButtonList>
  35. </OnboardingPanel>
  36. );
  37. }
  38. const ButtonList = styled(ButtonBar)`
  39. grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
  40. `;
  41. const Paragraph = styled('p')`
  42. font-size: ${p => p.theme.fontSizeLarge};
  43. `;