package com.base.scanqrclear.bean

import com.base.scanqrclear.bean.FunctionUIBean.Companion.KEY_FACEBOOK

data class FacebookUIBean(
    val urlOrId: String
) : ScanBean(KEY_FACEBOOK) {

    companion object {

        fun createFaceBookUIBean(qrCodeValue: String): FacebookUIBean {
            val urlOrId = qrCodeValue.substring(13, qrCodeValue.length)
            return FacebookUIBean(urlOrId)
        }

        fun isFacebookQR(qrCodeValue: String): Boolean {
            return qrCodeValue.startsWith("fb://profile")
        }

        //        fb://profile/www.baidu.con
        //        fb://profile/123456
        fun FacebookUIBean.createFacebookQrString(): String {
            return "fb://profile/$urlOrId"
        }

    }
}