Skip to content

Instantly share code, notes, and snippets.

@varmais
Last active June 5, 2018 16:54
Show Gist options
  • Save varmais/be699411bc6bcc612e7bfdb2e29b78d5 to your computer and use it in GitHub Desktop.
Save varmais/be699411bc6bcc612e7bfdb2e29b78d5 to your computer and use it in GitHub Desktop.
import * as React from 'react';
import { Book } from '../../model';
interface Props {
book: Book;
}
export const BookView: React.SFC<Props> = (props: Props) => {
if (!props.book) {
return <div>Finding requested book.</div>;
}
return (
<div>
<h2>{props.book.title}</h2>
<ul className="list-unstyled">
<li><strong> Author: </strong> {props.book.author.name }</li>
<li><strong>ISBN:</strong> {props.book.isbn}</li>
<li><strong>Price:</strong> {props.book.price}</li>
</ul>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment