performanceWidgetContainer.tsx 618 B

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