equal
deleted
inserted
replaced
1 import React from 'react'; |
1 import React from 'react'; |
2 |
2 |
3 import PropTypes from 'prop-types'; |
3 import PropTypes from 'prop-types'; |
4 import Immutable from 'immutable'; |
4 import Immutable from 'immutable'; |
5 |
5 |
6 import { ListGroup, ListGroupItem} from 'react-bootstrap'; |
6 import { ListGroup, ListGroupItem, Alert } from 'react-bootstrap'; |
7 |
7 |
8 import Note from './Note'; |
8 import Note from './Note'; |
9 |
9 |
10 const NotesList = ({notes}) => { |
10 const NotesList = ({notes}) => { |
|
11 |
|
12 if (notes.size === 0) { |
|
13 return ( |
|
14 <Alert bsStyle="warning">No notes yet. Add notes with the textarea below.</Alert> |
|
15 ); |
|
16 } |
|
17 |
11 return ( |
18 return ( |
12 <ListGroup> |
19 <ListGroup> |
13 {notes.map((note) => |
20 {notes.map((note) => |
14 <ListGroupItem key={note.id}><Note note={note} /></ListGroupItem> |
21 <ListGroupItem key={note.id}><Note note={note} /></ListGroupItem> |
15 )} |
22 )} |
16 </ListGroup> |
23 </ListGroup> |
17 ); |
24 ); |
18 }; |
25 }; |