File size: 709 Bytes
8cd46d1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import React from 'react';
import { Container } from './style';
function index(props) {
const differentColors = (category) => {
switch (category) {
case (category = 'Depósito'):
return '#00b563';
case (category = 'Pagamento'):
return '#b50052';
case (category = 'Retirada'):
return 'b56300';
default:
return null;
}
};
return (
<Container>
<div>
<p style={{ color: differentColors(props.category) }}>
{props.category}
</p>
</div>
<div>
<p>R$ {props.amount}</p>
</div>
<div>
<p>{props.created_at}</p>
</div>
</Container>
);
}
export default index;
|