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