Files
Iris/src/js/components/Popularity.js
James Barnsley 1ce85499f9 Eslint autofix
2021-03-23 21:21:00 +13:00

24 lines
844 B
JavaScript
Executable File

import React, { memo } from 'react';
import { I18n } from '../locale';
export default memo((props) => {
if (props.popularity === undefined || props.popularity === null) {
return null;
}
return (
<span className="popularity">
<span className="popularity-bars">
<span className={`bar${props.popularity > 10 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 30 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 50 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 70 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 90 ? ' filled' : ''}`} />
</span>
<span className="popularity-value">
<I18n path="specs.popularity" percent={props.popularity} />
</span>
</span>
);
});