performanceWidgetContainer.tsx 665 B

123456789101112131415161718192021222324252627282930
  1. import styled from '@emotion/styled';
  2. import Panel from 'sentry/components/panels/panel';
  3. import {space} from 'sentry/styles/space';
  4. export type PerformanceWidgetContainerTypes = 'panel' | 'inline';
  5. const StyledPanel = styled(Panel)`
  6. display: flex;
  7. flex-direction: column;
  8. padding-top: ${space(2)};
  9. margin-bottom: 0;
  10. `;
  11. const Div = styled('div')``;
  12. const getPerformanceWidgetContainer = ({
  13. containerType,
  14. }: {
  15. containerType: PerformanceWidgetContainerTypes;
  16. }) => {
  17. if (containerType === 'panel') {
  18. return StyledPanel;
  19. }
  20. if (containerType === 'inline') {
  21. return Div;
  22. }
  23. return Div;
  24. };
  25. export default getPerformanceWidgetContainer;