1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/public/js/components/log/LogEntry.jsx
2020-02-20 08:30:17 +01:00

31 lines
1.0 KiB
JavaScript

var React = require('react');
var LogEntry = React.createClass({
propTypes: {
event: React.PropTypes.object.isRequired
},
render: function() {
var d = new Date(this.props.event.createdAt);
var localEventData = JSON.parse(JSON.stringify(this.props.event.data));
delete localEventData.description;
delete localEventData.name;
return (
<tr>
<td>
{d.getDate() + "." + d.getMonth() + "." + d.getFullYear()}<br />
kl. {d.getHours() + "." + d.getMinutes()}
</td>
<td>
<strong>{this.props.event.data.name}</strong><em>[{this.props.event.type}]</em>
</td>
<td style={{maxWidth: 300}}>
<code className='JSON smalltext'>{JSON.stringify(localEventData)}</code>
</td>
<td>{this.props.event.createdBy}</td>
</tr>
);
}
});
module.exports = LogEntry;