1 import React from 'react'
2 import ColumnCard from './ColumnCard'
3 import yang from '../yang/leaf-utils.js'
5 export default class extends React.Component {
9 const { model, path, isReadonly, properties, editElement } = this.props;
10 const element = model.getElement(path);
11 console.debug(`LeafGroup: ${element.name}`);
12 const container = element.value;
13 const leaves = properties.reduce((leaves, property, index) => {
14 const itemPath = path.slice();
15 itemPath.push(property.name);
16 const props = { model, 'path': itemPath };
17 let value = (container && container[property.name]);
18 let valueIsSet = yang.isValueSet(property, value);
20 value = yang.getDefaultValue(property);
21 valueIsSet = yang.isValueSet(property, value);
24 value = yang.getDisplayValue(property, value);
26 valueIsSet && leaves.push(
27 <div key={property.name} className='leaf-group-leaf' style={{ maxWidth: '400px' }} >
28 <div style={{ fontSize: 'small', color: 'gray' }} >{`${property.name}`}</div>
29 <div style={{paddingLeft: '4px'}} >{value}</div>
35 <ColumnCard path={path}>
36 <div className='leaf-group'>
42 console.error("component render", e);