File size: 923 Bytes
10ed4af
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import React, { useState } from 'react';
import SkeletonTransaction from '../../components/SkeletonTransaction';
import StatementTransaction from '../../components/StatementTransaction';
import { Container } from './style';

function Statement(props) {
  const loading = props.loading;
  const statement = props.statement;

  return (
    <Container>
      <h2>Últimas movimentações</h2>
      <div>
        {loading && !statement && <SkeletonTransaction transactions={5} />}
        {statement &&
          statement.map((transaction,index) => {
            return (
              <StatementTransaction
                loading={loading}
                category={transaction.category}
                created_at={transaction.created_at}
                amount={transaction.amount}
                key={index}
              />
            );
          })}
      </div>
    </Container>
  );
}

export default Statement;