Skip to content

Instantly share code, notes, and snippets.

@anomaly44
Created November 23, 2015 23:09
Show Gist options
  • Save anomaly44/98d57c59b709e5543798 to your computer and use it in GitHub Desktop.
Save anomaly44/98d57c59b709e5543798 to your computer and use it in GitHub Desktop.
/**
* Created by rob on 11/18/15.
*/
import React, {Component, PropTypes } from 'react';
export default class ReportItem extends Component {
static propTypes = {
entry: PropTypes.object.isRequired
}
getImagePath() {
const entry = this.props.entry;
return '/problems/' + entry.image;
}
render() {
const entry = this.props.entry;
return (<div key={entry.id}>
<h4>{entry.name}</h4>
<img src={this.getImagePath()}></img>
</div>);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment