They've changed their default settings, this changes a lot of stuff in our code base.
22 lines
542 B
JavaScript
22 lines
542 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
|
|
export const TorrentsStat = ({ count, torrentCount, torrentCountById }) => {
|
|
if (torrentCount === undefined) {
|
|
return <span>No torrents</span>;
|
|
}
|
|
|
|
const percentage = Math.floor((torrentCountById * 100) / count);
|
|
return (
|
|
<span>
|
|
{percentage}% with torrents
|
|
<small> - {torrentCount} total</small>
|
|
</span>
|
|
);
|
|
};
|
|
TorrentsStat.propTypes = {
|
|
count: PropTypes.number,
|
|
torrentCount: PropTypes.number,
|
|
torrentCountById: PropTypes.number,
|
|
};
|