/**
 * 이 클래스는 camera 의 설정을 위한 에디터로 동작한다.
 */

import { LitElement, html, css } from 'lit-element'
import { ThingsEditorProperty, ThingsEditorPropertyStyles } from '@things-factory/modeller-ui'

import '../component/robot-arm-joints-input'
import '../component/robot-arm-controller'

export class OffsetJointsEditor extends ThingsEditorProperty {
  static get styles() {
    return [ThingsEditorPropertyStyles]
  }

  static get properties() {
    return {
      value: Object,
      host: Object
    }
  }

  editorTemplate(props) {
    if ('connection' in this.host) {
      var connection = this.host.connection // case host is a task
    } else {
      var connection = this.host.name // case host is a connection
    }

    return html`
      <div fullwidth>
        <robot-arm-joints-input .connection=${connection} .value=${this.value}></robot-arm-joints-input>
        <robot-arm-controller .connection=${connection}></robot-arm-controller>
      </div>
    `
  }
}

customElements.define('offset-joints-editor', OffsetJointsEditor)
