package com.gh.gamecenter.setting.provider

import android.content.Context
import android.content.Intent
import android.net.Uri
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.EnvHelper
import com.gh.gamecenter.core.provider.IWebProvider

@com.therouter.inject.ServiceProvider
class WebProviderImpl : IWebProvider {
    override fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent {
        return Intent(Intent.ACTION_VIEW).apply {
            data = Uri.parse(url)
        }
    }

    override fun getWebIntent(context: Context, title: String, url: String): Intent {
        return Intent(Intent.ACTION_VIEW).apply {
            data = Uri.parse(url)
        }
    }

    override fun getBindWechatIntent(context: Context): Intent {
        val url: String = if (EnvHelper.isDevEnv) {
            Constants.WECHAT_BIND_ADDRESS_DEV
        } else {
            Constants.WECHAT_BIND_ADDRESS
        }
        return Intent(Intent.ACTION_VIEW).apply {
            data = Uri.parse(url)
        }
    }

    override fun getQAIntent(
        context: Context?,
        url: String?,
        title: String?,
        isWebPageHandleBackPressed: Boolean,
        qaType: Int
    ): Intent? {
        return null
    }

    override fun getIntentByNews(
        context: Context?,
        concernLink: String?,
        concernGameName: String,
        concernId: String?,
        entrance: String?
    ): Intent? {
        return null
    }
}