import * as hmUI from '@zos/ui'
import { getText } from '@zos/i18n'
import { getDeviceInfo } from '@zos/device'
import { px } from '@zos/utils'

export const { width: DEVICE_WIDTH, height: DEVICE_HEIGHT } = getDeviceInfo()

export const layout = {
  refs: {},
  render(vm) {
    this.state = vm.state
    this.build()
  },

  build() {
    hmUI.createWidget(hmUI.widget.TEXT, {
      text: getText('appName'),
      x: px(42),
      y: px(200),
      w: DEVICE_WIDTH - px(42 * 2),
      h: px(100),
      color: 0xffffff,
      text_size: px(36),
      align_h: hmUI.align.CENTER_H,
      text_style: hmUI.text_style.WRAP,
    })
  },
}
