var React = require('react');
var _ = require('underscore');

module.exports = React.createClass({
  render: function() {
    console.log('console:' + this.props.x + ' ' + this.props.y);
    let styles = {
      group: {
        transform: 'scale(0.5, 0.5)'
      },
      consoleText: {
        color: '#ddd',
        fill: '#ddd',
        stroke: '#ddd'
      },
      consoleCursor: {
        color: '#ddd',
        fill: '#ddd',
        fontSize: '8'
      }
    };
    let { x, y, width, height } = this.props;
    var consoleTextCmd;
    switch(Math.floor(_.random(0, 2))) {
      case 0: { consoleTextCmd = '> vi'; break; }
      case 1: { consoleTextCmd = '> ls'; break; }
      case 2: { consoleTextCmd = '> pwd'; break; }
    }
    //rects
        //<rect style={styles.consoleCursor} x={0} y={0} width={20} height={20}/>
    return (
      <g style={styles.group} {...this.props}>
        <text x={20} y={height} width={width} height={height}
          fontFamily="FixedSys"
          style={styles.consoleText}>
          {consoleTextCmd}
        </text>
      </g>
    );
  }
});

