Grégoire Delattre 4b26080193
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Update redux state management
Use immer with native javascript objects instead of immutablejs.
2020-04-07 18:22:26 +02:00

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,
};