2014-11-13 15:14:41 +01:00
|
|
|
var React = require('react');
|
|
|
|
|
2014-11-14 07:29:55 +01:00
|
|
|
var LogEntry = React.createClass({
|
2014-11-13 15:14:41 +01:00
|
|
|
propTypes: {
|
|
|
|
event: React.PropTypes.object.isRequired
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
2014-11-17 10:10:47 +01:00
|
|
|
var d = new Date(this.props.event.createdAt);
|
2014-11-17 11:15:10 +01:00
|
|
|
var localEventData = JSON.parse(JSON.stringify(this.props.event.data));
|
|
|
|
delete localEventData.description;
|
|
|
|
delete localEventData.name;
|
2014-11-13 15:14:41 +01:00
|
|
|
return (
|
|
|
|
<tr>
|
2014-11-17 10:10:47 +01:00
|
|
|
<td>
|
|
|
|
{d.getDate() + "." + d.getMonth() + "." + d.getFullYear()}<br />
|
|
|
|
kl. {d.getHours() + "." + d.getMinutes()}
|
|
|
|
</td>
|
|
|
|
<td>
|
2014-11-17 11:15:10 +01:00
|
|
|
<strong>{this.props.event.data.name}</strong><em>[{this.props.event.type}]</em>
|
2014-11-17 10:10:47 +01:00
|
|
|
</td>
|
|
|
|
<td>
|
2014-11-17 11:15:10 +01:00
|
|
|
<code className='JSON'>{JSON.stringify(localEventData)}</code>
|
2014-11-17 10:10:47 +01:00
|
|
|
</td>
|
2014-11-13 15:14:41 +01:00
|
|
|
<td>{this.props.event.createdBy}</td>
|
|
|
|
</tr>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-11-14 07:29:55 +01:00
|
|
|
module.exports = LogEntry;
|