package com.fastcashier.lib_common.ui.dialog

import android.content.Context
import android.util.AttributeSet
import kotlin.jvm.JvmOverloads
import androidx.constraintlayout.widget.ConstraintLayout
import android.view.LayoutInflater
import com.fastcashier.lib_common.R
import com.fastcashier.lib_common.databinding.LayoutCommonPromptViewBinding

class CommonPromptView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {

    private val viewBinding: LayoutCommonPromptViewBinding

    init {
        val inflate =
            LayoutInflater.from(getContext()).inflate(R.layout.layout_common_prompt_view, this)
        viewBinding = LayoutCommonPromptViewBinding.bind(inflate)
    }

    fun setPromptImage(imageResId: Int) {
        viewBinding.ivPrompt.setImageResource(imageResId)
    }

    fun setPromptText(text: String?) {
        viewBinding.tvPrompt.text = text
    }
}