import React, {PropTypes} from 'react';

const SourceIndicator = React.createClass({
  propTypes: {
    source: PropTypes.shape({}).isRequired,
  },

  render() {
    const {source} = this.props;
    return (
      <div className="source-indicator">
        <span className="icon server"></span>
        {source && source.name}
      </div>
    );
  },
});

export default SourceIndicator;

import React, {PropTypes} from 'react';

const SourceIndicator = React.createClass({
  propTypes: {
    sourceName: PropTypes.string,
  },

  render() {
    const {sourceName} = this.props;
    if (!sourceName) {
      return null;
    }
    return (
      <div className="source-indicator">
        <span className="icon server"></span>
        {sourceName}
      </div>
    );
  },
});

export default SourceIndicator;

Change sourceIndicator to receive a string instead of an object
Change sourceIndicator to receive a string instead of an object
