/**1* Copyright (c) 2014-2015, Facebook, Inc.2* All rights reserved.3*4* This source code is licensed under the BSD-style license found in the5* LICENSE file in the root directory of this source tree. An additional grant6* of patent rights can be found in the PATENTS file in the same directory.7*/89var React = require('react');10var TodoActions = require('../actions/TodoActions');11var TodoTextInput = require('./TodoTextInput.react');1213var Header = React.createClass({1415/**16* @return {object}17*/18render: function() {19return (20<header id="header">21<h1>todos</h1>22<TodoTextInput23id="new-todo"24placeholder="What needs to be done?"25onSave={this._onSave}26/>27</header>28);29},3031/**32* Event handler called within TodoTextInput.33* Defining this here allows TodoTextInput to be used in multiple places34* in different ways.35* @param {string} text36*/37_onSave: function(text) {38if (text.trim()){39TodoActions.create(text);40}4142}4344});4546module.exports = Header;474849