var cloudflare = require('../cloudflare');
var React = require('react');
var Domain = React.createClass({
render: function() {
var className = this.props.active ? 'active' : '';
return (
{this.props.data.zone_name}
);
}
});
var DomainList = React.createClass({
getInitialState: function() {
return {domains: []};
},
componentDidMount: function() {
cloudflare.domains().then(function(data) {
this.setState({domains: data.response.zones.objs});
}.bind(this));
},
render: function() {
var currDomain = this.props.currentDomain;
var domains = this.state.domains.map(function(domain) {
var active = currDomain === domain.zone_name;
return
});
return (
);
}
});
module.exports = DomainList;