DataJPA_V2/src/components/List/index.js
2020-05-17 18:12:36 +07:00

34 lines
686 B
JavaScript

import React from 'react';
import { MdAdd } from 'react-icons/md';
import Card from '../Card';
import { Container } from './styles';
export default function List({ data, index: listIndex }) {
return (
<Container done={data.done}>
<header>
<h2>{data.title}</h2>
{data.creatable && (
<button type="button">
<MdAdd size={24} color="#FFF" />
</button>
)}
</header>
<ul>
{ data.cards.map((card, index) => (
<Card
key={card.id}
listIndex={listIndex}
index={index}
data={card}
/>
)) }
</ul>
</Container>
);
}