opds-web-client
Version:
28 lines (27 loc) • 1.82 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require("react");
require("../stylesheets/book.scss");
var CatalogLink_1 = require("./CatalogLink");
var BookCover_1 = require("./BookCover");
var Book = (function (_super) {
__extends(Book, _super);
function Book() {
_super.apply(this, arguments);
}
Book.prototype.render = function () {
return (React.createElement("div", {className: "book"}, React.createElement(CatalogLink_1.default, {collectionUrl: this.props.collectionUrl, bookUrl: this.props.book.url || this.props.book.id}, React.createElement(BookCover_1.default, {book: this.props.book})), React.createElement("div", {className: "info"}, React.createElement(CatalogLink_1.default, {collectionUrl: this.props.collectionUrl, bookUrl: this.props.book.url || this.props.book.id}, React.createElement("div", {className: "title"}, this.props.book.title), React.createElement("div", {className: "authors"}, this.props.book.authors.length ?
this.props.book.authors.join(", ") :
this.props.book.contributors && this.props.book.contributors.length ?
this.props.book.contributors.join(", ") :
"")), this.props.book.openAccessLinks && this.props.book.openAccessLinks.length ?
React.createElement("div", {className: "links"}, React.createElement("a", {href: this.props.book.openAccessLinks[0].url, className: "btn btn-default"}, "Download")) : null)));
};
return Book;
}(React.Component));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Book;