package com.gh.gamecenter.gamedetail.accelerator

import android.content.Context
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.ShellActivity
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.toResString

/**
 * 会员功能 实名认证相关弹窗
 */
object UserVerifyDialogUtils {

    fun showUnVerifiedDialog(context: Context, title: String, content: String) {
        DialogHelper.showDialog(
            context,
            title = title,
            content = content,
            confirmText = R.string.go_to_real_name_authentication.toResString(),
            cancelText = "取消",
            confirmClickCallback = {
                context.startActivity(
                    ShellActivity.getIntent(
                        context,
                        ShellActivity.Type.REAL_NAME_INFO
                    ).apply {
                        putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, "游戏实名")
                        putExtra(EntranceConsts.KEY_IS_FORCED_TO_CERTIFICATE, true)
                    }
                )

                NewLogUtils.logCertificationHintDialogOptionsClicked("前往实名认证")
                SensorsBridge.trackVerificationPopupClick("前往实名认证")
            },
            cancelClickCallback = {
                NewLogUtils.logCertificationHintDialogOptionsClicked("取消")
                SensorsBridge.trackVerificationPopupClick("取消")
            }
        )
    }

    fun showMinorsOrVerifyingDialog(context: Context, title: String, content: String) {
        DialogHelper.showDialog(
            context,
            title = title,
            content = content,
            confirmText = R.string.dialog_hint_confirm.toResString(),
            cancelText = "",
        )
    }
}