1
|
import { Center, VStack, Box, Text, HStack } from "native-base";
|
2
|
import { Note } from "../../types/note";
|
3
|
import NoteView from "./NoteView";
|
4
|
|
5
|
const NotesListView = (props: { notes: Note[] }) => {
|
6
|
const notes = props.notes;
|
7
|
return (
|
8
|
<VStack>
|
9
|
{
|
10
|
notes && notes.length > 0 ? (
|
11
|
<VStack>
|
12
|
{notes.map((note, index) => (
|
13
|
<NoteView key={index} note={note}/>
|
14
|
))}
|
15
|
</VStack>
|
16
|
) : (
|
17
|
<Text>There are no notes.</Text>
|
18
|
)
|
19
|
}
|
20
|
</VStack>
|
21
|
);
|
22
|
}
|
23
|
|
24
|
export default NotesListView
|