import React from "react";

class IntroWithButton extends React.Component {
  static displayName = "Panel.IntroWithButton";

  static propTypes = {
    children: React.PropTypes.node.isRequired
  };

  render() {
    return (
      <div className="py3 px3 flex">
        {this.props.children[0]}
        <div className="ml3">
          {this.props.children[1]}
        </div>
      </div>
    );
  }
}

export default IntroWithButton;

@@ -214,166 +214,426 @@
     
-return (%0A      %3Cdiv className=%22py3 px3 flex%22%3E%0A        %7Bthis
+let children = React.Children.toArray(this.props.children);%0A%0A    let intro;%0A    let button;%0A    if(children.length == 1) %7B%0A      intro = children;%0A    %7D else %7B%0A      button = children
 .p
-r
 op
-s.children%5B0%5D%7D%0A        %3Cdiv className=%22ml3%22%3E%0A          %7Bthis.props.children%5B1%5D%7D%0A        %3C/div%3E
+();%0A      intro = children;%0A    %7D%0A%0A    if(button) %7B%0A      button = (%0A        %3Cdiv className=%22ml3%22%3E%0A          %7Bbutton%7D%0A        %3C/div%3E%0A      );%0A    %7D%0A%0A    return (%0A      %3Cdiv className=%22py3 px3 flex%22%3E%0A        %7Bintro%7D%0A        %7Bbutton%7D
 %0A   

Handle case where IntroWithButton has no button