bbgo_origin/apps/frontend/components/Summary.tsx

51 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-06-16 08:47:35 +00:00
import { styled } from '@mui/styles';
2022-06-16 14:52:32 +00:00
import { GridStats } from '../api/bbgo';
2022-06-16 08:47:35 +00:00
const SummarySection = styled('div')(() => ({
width: '100%',
display: 'flex',
justifyContent: 'space-around',
backgroundColor: 'rgb(255, 245, 232)',
2022-06-16 10:17:59 +00:00
margin: '10px 0',
2022-06-16 08:47:35 +00:00
}));
const SummaryBlock = styled('div')(() => ({
padding: '5px 0 5px 0',
}));
export const StatsTitle = styled('div')(() => ({
margin: '0 0 10px 0',
}));
export const StatsValue = styled('div')(() => ({
marginBottom: '10px',
color: 'rgb(123, 169, 90)',
}));
export const Percentage = styled('div')(() => ({
color: 'rgb(123, 169, 90)',
}));
2022-06-16 14:30:05 +00:00
export default function Summary({
stats,
totalProfitsPercentage,
}: {
stats: GridStats;
totalProfitsPercentage: number;
}) {
2022-06-16 08:47:35 +00:00
return (
<SummarySection>
<SummaryBlock>
<StatsTitle>Investment USDT</StatsTitle>
<div>{stats.investment}</div>
</SummaryBlock>
<SummaryBlock>
<StatsTitle>Total Profit USDT</StatsTitle>
<StatsValue>{stats.totalProfits}</StatsValue>
<Percentage>{totalProfitsPercentage}%</Percentage>
</SummaryBlock>
</SummarySection>
2022-06-16 14:30:05 +00:00
);
}