opds-web-client
Version:
31 lines (30 loc) • 1.6 kB
JavaScript
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");
var CatalogLink_1 = require("./CatalogLink");
var BookCover_1 = require("./BookCover");
var Book = (function (_super) {
__extends(Book, _super);
function Book() {
return _super.apply(this, arguments) || this;
}
Book.prototype.render = function () {
return (React.createElement("div", { className: "book", lang: this.props.book.language },
React.createElement(CatalogLink_1.default, { collectionUrl: this.props.collectionUrl, bookUrl: this.props.book.url || this.props.book.id, title: this.props.book.title },
React.createElement(BookCover_1.default, { book: this.props.book }),
React.createElement("div", { className: "info" },
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(", ") :
"")))));
};
return Book;
}(React.Component));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Book;
;