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>
|
2014-11-29 14:25:27 +01:00
|
|
|
<td style={{maxWidth: 300}}>
|
2014-12-11 08:19:31 +01:00
|
|
|
<code className='JSON smalltext man'>{JSON.stringify(localEventData, null, 2)}</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;
|