
@ComponentV2
export struct TextItemView {
  @Param image?: Resource = undefined;
  @Param leftText: string = '';
  @Param rightText: string = '';

  build() {
    Row() {
      Image(this.image)
        .width(20)
        .height(20)
        .margin({ left: 14 })
        .visibility(this.image ? Visibility.Visible : Visibility.None)

      Text(this.leftText)
        .fontColor($r('app.color.color_1a1a1a'))
        .fontSize(15)
        .layoutWeight(1)
        .margin({ left: 10 })

      Text(this.rightText)
        .fontColor($r('app.color.color_666666'))
        .fontSize(15)
        .margin({ right: 1 })

      Image($r('app.media.ic_arrow_dp22'))
        .margin({ right: 8 })
        .width(22)
        .height(22)
    }
    .width('100%')
    .height('100%')
  }
}