openreplay/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/SpeedIndexByLocation/Scale.js
Андрей Бабушкин b822b1c067 applied eslint
2025-02-26 20:31:01 +01:00

27 lines
750 B
JavaScript

import React from 'react';
import cn from 'classnames';
import { Styles } from '../../common';
import stl from './scale.module.css';
function Scale({ colors }) {
const lastIndex = (Styles.compareColors.length - 1);
return (
<div className={cn(stl.bars, 'absolute bottom-0 mb-4')}>
{Styles.compareColors.map((c, i) => (
<div
key={i}
style={{
backgroundColor: c, width: '6px', height: '15px', marginBottom: '1px',
}}
className="flex items-center justify-center"
>
{i === 0 && <div className="text-xs pl-12">Slow</div>}
{i === lastIndex && <div className="text-xs pl-12">Fast</div>}
</div>
))}
</div>
);
}
export default Scale;