/**
* @providesModule AutodocsLayout
* @jsx React.DOM
*/
var DocsSidebar = require('DocsSidebar');
var Header = require('Header');
var Marked = require('Marked');
var React = require('React');
var Site = require('Site');
var Autodocs = React.createClass({
renderProp: function(name, prop) {
return (
{name}
{' '}
{prop.type && {prop.type.name}}
{prop.description && {prop.description}}
);
},
renderProps: function(props) {
var result = Object.keys(props).sort().map((name) =>
this.renderProp(name, props[name])
);
return {result}
;
},
render: function() {
var metadata = this.props.metadata;
var content = JSON.parse(this.props.children);
return (
{metadata.title}
{content.description}
{this.renderProps(content.props)}
{content.fullDescription}
);
}
});
module.exports = Autodocs;