The communications platform that puts data protection first.
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.
 
 
 
 
 
Rocket.Chat/client/components/data/Growth.js

18 lines
492 B

import { Box } from '@rocket.chat/fuselage';
import React from 'react';
import NegativeGrowthSymbol from './NegativeGrowthSymbol';
import PositiveGrowthSymbol from './PositiveGrowthSymbol';
function Growth({ children, ...props }) {
if (children === 0) {
return null;
}
return <Box is='span' color={children < 0 ? 'danger' : 'success'} {...props}>
{children < 0 ? <NegativeGrowthSymbol /> : <PositiveGrowthSymbol />}
{String(Math.abs(children))}
</Box>;
}
export default Growth;