// @flow

// Vendor
import React from 'react';
import styled from 'styled-components';

// Components
import Book from './Book';

// Utils/Common
import type { BookType } from '../common/flowTypes';

/* ------------------------------------------------------------------
   ----------------------------- STYLES -----------------------------
	 ------------------------------------------------------------------ */

/** A flexbox grid wrapper, into which we insert our Books */
const FlybraryBookList = styled.div`
	display: flex;
	flex-wrap: wrap;
	margin-top: 12px;
	margin-bottom: 12px;
	justify-content: center;
`;

/* ------------------------------------------------------------------
   --------------------------- COMPONENTS ---------------------------
	 ------------------------------------------------------------------ */

/**
 * View component that displays a list of Books.
 * @prop {Array<BookType>}   books   	An Array of Book data objects to be displayed
 * @prop {(BookType, string) => void} handleShelfUpdate from App
 * @prop {(string) => string} findShelf from App
 */
const BookList = (props: {
	books: Array<BookType>,
	handleShelfUpdate: (BookType, string) => void,
	findShelf: string => string
}) => {
	const { books, handleShelfUpdate, findShelf } = props;

	// Map our book data objects into Book components
	const bookElements = books.map(book => {
		return (
			<Book
				book={book}
				key={book.id}
				handleShelfUpdate={handleShelfUpdate}
				findShelf={findShelf}
			/>
		);
	});

	return (
		<FlybraryBookList className="book-list">
			{bookElements}
		</FlybraryBookList>
	);
};

export default BookList;

@@ -881,19 +881,20 @@
 s.%0A * @p
-rop
+aram
  %7BArray%3C
@@ -970,96 +970,120 @@
 * @p
-rop %7B(BookType, string) =%3E void%7D handleShelfUpdate from App%0A * @prop %7B(string) =%3E 
+aram %7Bfunction(string, number)%7D handleShelfUpdate from %7B@link App#handleShelfUpdate%7D%0A * @param %7Bfunction(
 string
+)
 %7D fi
@@ -1095,19 +1095,37 @@
 lf from 
-App
+%7B@link App#findShelf%7D
 %0A */%0Acon

update BookList jsdoc