You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.0 KiB

import React, { useContext } from 'react';
import { AppContext } from './ContextProvider';
import { ToCoins, ToDate, ToHashes } from '../helpers/utils';
const Pool = () => {
const { state } = useContext(AppContext);
const { pool } = state;
const { networkStats, stats } = pool;
const { pool_statistics: poolStats } = stats;
const networkHashRate = Math.floor(networkStats.difficulty / 300);
const poolPercentage = poolStats.hashRate / networkHashRate * 100;
return (
<div className="pool">
<p>all wow miners: <ToHashes hashes={networkHashRate} /></p>
<p>this pool miners: {poolStats.miners} miners digging <ToHashes hashes={poolStats.hashRate} /> (only {poolPercentage.toFixed(2)}%)</p>
<p>world blocke: {networkStats.height} with <ToCoins coins={networkStats.value} /> discovered {<ToDate timeStamp={networkStats.ts} />}</p>
<p>pool blocke: {poolStats.lastBlockFound} discovered {<ToDate timeStamp={poolStats.lastBlockFoundTime} />}</p>
</div>
)
};
export default Pool;