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

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

import { html } from 'lit-element'

import { OxPropertyEditor } from '@operato/property-editor'

export class PoseEditor extends OxPropertyEditor {
  static get styles() {
    return [...OxPropertyEditor.styles]
  }

  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-pose-input .connection=${connection} .value=${this.value}></robot-arm-pose-input>
        <robot-arm-controller .connection=${connection}></robot-arm-controller>
      </div>
    `
  }
}

customElements.define('pose-editor', PoseEditor)
