import TFPComponentRender from '../render.js'

export default class SwitchRender extends TFPComponentRender {
  
  constructor(__tfp, _dataModel, _level) {
  	super(__tfp, _dataModel, _level);
  }

  getBodyHtml(getComponentsHtml) {
    let bodyHtml = "";
    let indent = this.getHtmlIndent();
    if(!this.dataModel.options || this.dataModel.options.length!=2) 
      this.dataModel.options = [false, true];
    bodyHtml += "<div";
    if((this.value+"")==(this.dataModel.options[1]+"")) 
      bodyHtml += " style=\"float: right; background-color:#0099ff;\"";
    bodyHtml += "></div>";
    return bodyHtml;
  }

  getHtml(getComponentsHtml, parentIndent, retainStyleAttr) {
    return super.getHtml("div", false, parentIndent, retainStyleAttr);
  }
}