Skip to content

Instantly share code, notes, and snippets.

@MonkeyDo
Last active February 12, 2019 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MonkeyDo/09a9aa6a29f4208ffaeb8a99750ae7fb to your computer and use it in GitHub Desktop.
Save MonkeyDo/09a9aa6a29f4208ffaeb8a99750ae7fb to your computer and use it in GitHub Desktop.
<div>
<h2>Works</h2>
{
entity.works.length ?
<React.Fragment>
<Table striped>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
</tr>
</thead>
<tbody>
{
entity.works.map((work) => (
<WorkTableRow
key={work.bbid}
work={work}
/>
))}
</tbody>
</Table>
<Button
bsStyle="success"
className="margin-top-d15"
href={`/work/create?${
entity.type.toLowerCase()}=${entity.bbid}`}
>
<Icon className="margin-right-0-5" name="plus"/>Add Work
</Button>
</React.Fragment> :
<React.Fragment>
<span className="margin-right-2 pull-left">
<Button
bsStyle="success"
href={`/work/create?${
entity.type.toLowerCase()}=${entity.bbid}`}
>
<Icon name="pen-nib" size="2x"/>
<br/>
Add Work
</Button>
</span>
<span>
<h4>There are no Works yet!</h4>
<p>
Help us complete BookBrainz
<br/>
</p>
<br/><small>Not sure what to do? Visit the <a href="/help">help page</a> to get started.</small>
</span>
</React.Fragment>
}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment