import { promptAction } from "@kit.ArkUI"

@Component
export struct ReNameInput{
  @Prop text:string="未命名"
  @State isFocus:boolean=false
  inputChange=(value:string)=>{

  }
  build() {
    Row({space:10}){
      TextInput({text:$$this.text})
        .width(194)
        .height(30)
        .padding(0)
        .fontColor('#564F4A')
        .borderRadius(0)
        .backgroundColor(Color.Transparent)
        // .enableKeyboardOnFocus(this.isFocus)
        .onChange((value:string)=>{
          if(value.length>5){
            this.text = value.slice(0, 5)
            promptAction.showToast({
              message:"名称最多不超过五个"
            })
            return
          }
          this.inputChange(value)
        })
    }

  }
}