lineChartWidget.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import styled from '@emotion/styled';
  2. import {
  3. WidgetFrame,
  4. type WidgetFrameProps,
  5. } from 'sentry/views/dashboards/widgets/common/widgetFrame';
  6. import {
  7. LineChartWidgetVisualization,
  8. type LineChartWidgetVisualizationProps,
  9. } from 'sentry/views/dashboards/widgets/lineChartWidget/lineChartWidgetVisualization';
  10. import {X_GUTTER, Y_GUTTER} from '../common/settings';
  11. import type {StateProps} from '../common/types';
  12. interface Props
  13. extends StateProps,
  14. Omit<WidgetFrameProps, 'children'>,
  15. LineChartWidgetVisualizationProps {}
  16. export function LineChartWidget(props: Props) {
  17. const {timeseries} = props;
  18. return (
  19. <WidgetFrame
  20. title={props.title}
  21. description={props.description}
  22. actions={props.actions}
  23. error={props.error}
  24. onRetry={props.onRetry}
  25. >
  26. <LineChartWrapper>
  27. <LineChartWidgetVisualization
  28. timeseries={timeseries}
  29. utc={props.utc}
  30. meta={props.meta}
  31. />
  32. </LineChartWrapper>
  33. </WidgetFrame>
  34. );
  35. }
  36. const LineChartWrapper = styled('div')`
  37. flex-grow: 1;
  38. padding: 0 ${X_GUTTER} ${Y_GUTTER} ${X_GUTTER};
  39. `;