 DEFAULT_SETTINGS =
   sort: "goodreads_rating"
   onlyfiction: "yes"
+  onlyavailable: "no"
 
 SORT_FIELDS = [
   ["goodreads_rating", "Goodreads Rating"]

        b[@props.sort]

    React.DOM.ul className: "book-list",
      BookListItem(key: book.vpl_id, book: book, showFiction: @props.onlyfiction is "no") for id, book of books

BookListItem = React.createClass
  displayName: "BookListItem"

  shouldComponentUpdate: (nextProps, nextState) ->
    @props.book isnt nextProps.book or @props.showFiction isnt nextProps.showFiction

  render: ->
    { vpl_id, title, vpl_url, author, availability, available, availability_url, holds, vpl_rating, isbn, img, goodreads_id, goodreads_url, goodreads_rating, amazon_url, amazon_rating, goodreads_categories, description, fiction } = @props.book

  render: ->
    React.DOM.div className: "app",
      Settings(settings: @state.settings)
      BookList(books: @state.books, sort: @state.settings.sort, onlyfiction: @state.settings.onlyfiction, onlyavailable: @state.settings.onlyavailable)

BookList = React.createClass
  displayName: "BookList"
