projectScoreCards.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import styled from '@emotion/styled';
  2. import space from 'sentry/styles/space';
  3. import {Organization, PageFilters, SessionFieldWithOperation} from 'sentry/types';
  4. import ProjectApdexScoreCard from './projectApdexScoreCard';
  5. import ProjectStabilityScoreCard from './projectStabilityScoreCard';
  6. import ProjectVelocityScoreCard from './projectVelocityScoreCard';
  7. type Props = {
  8. hasSessions: boolean | null;
  9. isProjectStabilized: boolean;
  10. organization: Organization;
  11. selection: PageFilters;
  12. hasTransactions?: boolean;
  13. query?: string;
  14. };
  15. function ProjectScoreCards({
  16. organization,
  17. selection,
  18. isProjectStabilized,
  19. hasSessions,
  20. hasTransactions,
  21. query,
  22. }: Props) {
  23. return (
  24. <CardWrapper>
  25. <ProjectStabilityScoreCard
  26. organization={organization}
  27. selection={selection}
  28. isProjectStabilized={isProjectStabilized}
  29. hasSessions={hasSessions}
  30. query={query}
  31. field={SessionFieldWithOperation.SESSIONS}
  32. />
  33. <ProjectStabilityScoreCard
  34. organization={organization}
  35. selection={selection}
  36. isProjectStabilized={isProjectStabilized}
  37. hasSessions={hasSessions}
  38. query={query}
  39. field={SessionFieldWithOperation.USERS}
  40. />
  41. <ProjectVelocityScoreCard
  42. organization={organization}
  43. selection={selection}
  44. isProjectStabilized={isProjectStabilized}
  45. query={query}
  46. />
  47. <ProjectApdexScoreCard
  48. organization={organization}
  49. selection={selection}
  50. isProjectStabilized={isProjectStabilized}
  51. hasTransactions={hasTransactions}
  52. query={query}
  53. />
  54. </CardWrapper>
  55. );
  56. }
  57. const CardWrapper = styled('div')`
  58. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  59. display: grid;
  60. grid-column-gap: ${space(2)};
  61. grid-template-columns: repeat(2, minmax(0, 1fr));
  62. }
  63. @media (min-width: 1600px) {
  64. grid-template-columns: repeat(4, minmax(0, 1fr));
  65. }
  66. `;
  67. export default ProjectScoreCards;