<script>
import Running from './Running'
import ScreenShot from './ScreenShot'
import Download from './Download'

export default {
  name: 'DeviceRuntime',
  components: {
    Running,
    ScreenShot,
    Download
  },
  props: {
    online: {
      type: [Boolean, String],
      default: false
    }
  },
  render (h) {
    if (!this.online) {
      return h(
        'div',
        {
          staticClass: 'u-font-size--lg u-color--info u-text--center'
        },
        '设备当前未上线'
      )
    }
    return h(
      'div',
      {
        staticClass: 'l-grid--info'
      },
      [
        h('Running'),
        h('ScreenShot', { props: this.$attrs }),
        h('Download')
      ]
    )
  }
}
</script>
