/** @jsx React.DOM */
var MainMenu = React.createClass({
render: function(){
return (
Main Menu
);
}
});
var ToolsMenu = React.createClass({
render: function(){
return (Tools Menu
);
}
});
var ReportsMenu = React.createClass({
render: function(){
return (Reports Menu
);
}
});
var _Header_Entries = {
main: {
title: "Traffic",
route: "main",
menu: MainMenu
},
tools: {
title: "Tools",
route: "main",
menu: ToolsMenu
},
reports: {
title: "Visualization",
route: "reports",
menu: ReportsMenu
}
};
var Header = React.createClass({
getInitialState: function(){
return {active: "main"};
},
handleClick: function(active){
this.setState({active: active});
ReactRouter.transitionTo(_Header_Entries[active].route);
return false;
},
handleFileClick: function(){
console.log("File click");
},
render: function(){
var header = [];
for(var item in _Header_Entries){
var classes = this.state.active == item ? "active" : "";
header.push({ _Header_Entries[item].title });
}
var menu = _Header_Entries[this.state.active].menu();
return (
);
}
});