1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/component/history/history-item-json.jsx

32 lines
779 B
React
Raw Normal View History

2016-11-26 10:01:48 +01:00
import React, { PropTypes, PureComponent } from 'react';
2016-11-22 21:13:26 +01:00
import style from './history.scss';
2016-11-26 10:01:48 +01:00
class HistoryItem extends PureComponent {
2016-11-22 21:13:26 +01:00
2016-11-22 22:58:09 +01:00
static propTypes () {
return {
entry: PropTypes.object,
};
2016-11-22 21:13:26 +01:00
}
2016-12-03 15:18:01 +01:00
render () {
const localEventData = JSON.parse(JSON.stringify(this.props.entry));
2016-11-22 21:13:26 +01:00
delete localEventData.description;
delete localEventData.name;
delete localEventData.diffs;
const prettyPrinted = JSON.stringify(localEventData, null, 2);
return (
2016-12-03 15:18:01 +01:00
<div className={style['history-item']}>
<div>
<code className="JSON smalltext man">{prettyPrinted}</code>
</div>
</div>
2016-11-22 21:13:26 +01:00
);
}
}
export default HistoryItem;