performanceNewProjectPrompt.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import styled from '@emotion/styled';
  2. import {Button} from 'sentry/components/button';
  3. import {Alert} from 'sentry/components/core/alert';
  4. import {IconBusiness} from 'sentry/icons';
  5. import {t} from 'sentry/locale';
  6. import {space} from 'sentry/styles/space';
  7. import type {Organization} from 'sentry/types/organization';
  8. import {openUpsellModal} from 'getsentry/actionCreators/modal';
  9. type Props = React.PropsWithChildren<{
  10. features: Organization['features'];
  11. organization: Organization;
  12. }>;
  13. function PerformanceNewProjectPrompt({organization}: Props) {
  14. return (
  15. <Alert.Container>
  16. <StyledAlert type="info" showIcon>
  17. <Container>
  18. {t(
  19. `Performance is available for your platform, but your organization's plan does not include performance monitoring.`
  20. )}
  21. <StyledButton
  22. size="sm"
  23. priority="primary"
  24. icon={<IconBusiness />}
  25. onClick={() =>
  26. openUpsellModal({
  27. organization,
  28. source: 'feature.performance_new_project',
  29. })
  30. }
  31. >
  32. {t('Learn More')}
  33. </StyledButton>
  34. </Container>
  35. </StyledAlert>
  36. </Alert.Container>
  37. );
  38. }
  39. const Container = styled('div')`
  40. display: flex;
  41. align-items: center;
  42. justify-content: space-between;
  43. @media (max-width: ${p => p.theme.breakpoints.large}) {
  44. flex-direction: column;
  45. align-items: flex-start;
  46. }
  47. `;
  48. const StyledButton = styled(Button)`
  49. margin-left: ${space(1)};
  50. flex-shrink: 0;
  51. @media (max-width: ${p => p.theme.breakpoints.large}) {
  52. margin-left: 0;
  53. margin-top: ${space(1)};
  54. }
  55. `;
  56. const StyledAlert = styled(Alert)`
  57. align-items: center;
  58. margin-top: ${space(3)};
  59. ${StyledButton} svg {
  60. color: ${p => p.theme.button.primary.color};
  61. }
  62. @media (max-width: ${p => p.theme.breakpoints.medium}) {
  63. align-items: flex-start;
  64. }
  65. `;
  66. export default PerformanceNewProjectPrompt;