11import _ from 'lodash' ;
22import React , { Component , PropTypes } from 'react' ;
3- import { Segment , Table , TableColumn } from 'stardust' ;
3+ import { Header , Segment , Table , TableColumn } from 'stardust' ;
4+
5+ const DOCBLOCK_DESCRIPTION_DEFAULTS = {
6+ children : 'Body of the component.' ,
7+ className : 'Class names for custom styling.' ,
8+ } ;
49
510/**
611 * Displays a table of a Component's PropTypes.
@@ -34,7 +39,7 @@ export default class ComponentProps extends Component {
3439 const propsDefinition = this . props . props ;
3540 const content = _ . map ( propsDefinition , ( propConfig , propName ) => {
3641 const name = propName ;
37- const description = _ . get ( propConfig , 'docBlock.description' ) ;
42+ const description = _ . get ( propConfig , 'docBlock.description' ) || DOCBLOCK_DESCRIPTION_DEFAULTS [ name ] ;
3843
3944 const value = _ . get ( propConfig , 'type.value' ) ;
4045 let type = _ . get ( propConfig , 'type.name' ) ;
@@ -58,7 +63,7 @@ export default class ComponentProps extends Component {
5863
5964 return (
6065 < Segment className = 'basic vertical' >
61- < h2 className = 'ui header' > Props</ h2 >
66+ < Header . H2 className = 'ui header' > Props</ Header . H2 >
6267 < Table data = { content } className = 'very basic' >
6368 < TableColumn dataKey = 'name' cellRenderer = { this . nameRenderer } />
6469 < TableColumn dataKey = 'type' />
0 commit comments