spanRectangle.tsx 619 B

1234567891011121314151617181920212223
  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. style={{
  15. backgroundColor: theme.blue300,
  16. left: `min(${toPercent(bounds.left || 0)}, calc(100% - 1px))`,
  17. width: toPercent(bounds.width || 0),
  18. }}
  19. />
  20. );
  21. }