import { _decorator, Component, Node } from "cc";
import { BindGameUserInfo } from "../../scripts/mgr/PushMsgM";
import BaseUI from "../../scripts/base/BaseUI";
const { ccclass, property } = _decorator;

export interface LinkGameAccountItemClick {
  OnClick(user: BindGameUserInfo);
}

@ccclass("LinkGameAccountItem")
export class LinkGameAccountItem extends BaseUI {
  private l: LinkGameAccountItemClick;
  private user: BindGameUserInfo;
  init(user: BindGameUserInfo, cb: LinkGameAccountItemClick) {
    this.user = user;
    this.l = cb;
    this.setText("lbl_user_name", user.userName);
    this.setText("lbl_wallet", user.wallet);
  }

  protected simpleOnBtnClick(name: string): void {
    switch (name) {
      case "btn_link":
        this.l.OnClick(this.user);
        break;
    }
  }
}
