import AppConstants from "../../app/AppConstant"

/**
 * 空数据或者错误Item
 */
@Component
export struct EmptyOrErrorItemView {
  @State type: number= 0
  @State msg: string= "暂无数据"


  build() {
    Column() {
      Image(this.type == 0 ? $r('app.media.icon_empty') : $r('app.media.icon_error2'))
        .width($r('app.float.default_80'))
        .height($r('app.float.default_80'))

      Text(this.msg)
        .fontSize($r('app.float.text_size_14'))
        .fontColor($r('app.color.colorGrey6'))
        .textAlign(TextAlign.Center)
        .margin({ top: $r('app.float.default_10') })

    }
    .justifyContent(FlexAlign.Center)
    .alignItems(HorizontalAlign.Center)
    .width(AppConstants.PERCENTAGE_MAX)
    .height(AppConstants.PERCENTAGE_MAX)
  }
}