mon-entreprise/source/components/Rule.js

22 lines
452 B
JavaScript
Raw Normal View History

2016-12-07 18:08:10 +00:00
import React, { Component } from 'react'
import {findRuleByName} from '../model.js'
import './Rule.css'
import JSONTree from 'react-json-tree'
2016-12-07 18:08:10 +00:00
export default class Rule extends Component {
render() {
let json = findRuleByName(this.props.params.name)[2]
2016-12-07 18:08:10 +00:00
return (
<div id="variable">
<pre>
<code className="yaml">
<JSONTree hideRoot="true" shouldExpandNode={() => true} data={json} />
2016-12-07 18:08:10 +00:00
</code>
</pre>
</div>
)
}
}