39 lines
947 B
JavaScript
39 lines
947 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
|
|
import { TorrentsStat } from "./torrentsStat";
|
|
|
|
export const Stat = ({ name, count, torrentCount, torrentCountById }) => (
|
|
<div className="col-12 col-md-4 my-2">
|
|
<div className="card">
|
|
<div className="card-header">
|
|
<h3>
|
|
{name}
|
|
<span className="badge badge-pill badge-info pull-right">
|
|
{count}
|
|
</span>
|
|
</h3>
|
|
</div>
|
|
<div className="card-body">
|
|
<TorrentsStat
|
|
count={count}
|
|
torrentCount={torrentCount}
|
|
torrentCountById={torrentCountById}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
Stat.propTypes = {
|
|
name: PropTypes.string.isRequired,
|
|
count: PropTypes.number.isRequired,
|
|
torrentCount: PropTypes.number.isRequired,
|
|
torrentCountById: PropTypes.number.isRequired,
|
|
};
|
|
Stat.defaultProps = {
|
|
name: "",
|
|
count: 0,
|
|
torrentCount: 0,
|
|
torrentCountById: 0,
|
|
};
|