spanRectangle.tsx 646 B

123456789101112131415161718192021222324
  1. import {RowRectangle} from 'sentry/components/performance/waterfall/rowBar';
  2. import {toPercent} from 'sentry/components/performance/waterfall/utils';
  3. import theme from 'sentry/utils/theme';
  4. import {EnhancedSpan} from './types';
  5. import {SpanViewBoundsType} from './utils';
  6. export default function SpanRectangle({
  7. bounds,
  8. }: {
  9. bounds: SpanViewBoundsType;
  10. spanGrouping: EnhancedSpan[];
  11. }) {
  12. return (
  13. <RowRectangle
  14. spanBarHatch={false}
  15. style={{
  16. backgroundColor: theme.blue300,
  17. left: `min(${toPercent(bounds.left || 0)}, calc(100% - 1px))`,
  18. width: toPercent(bounds.width || 0),
  19. }}
  20. />
  21. );
  22. }