package com.adealink.weparty.profile.ui.about.adapter

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import com.adealink.frame.util.onClick
import com.adealink.weparty.commonui.recycleview.adapter.BindingViewHolder
import com.adealink.weparty.commonui.recycleview.adapter.multitype.ItemViewBinder
import com.adealink.weparty.profile.databinding.LayoutProfileDynamicEmptyBinding
import com.adealink.weparty.profile.ui.about.data.DynamicEmptyItemData


class EmptyDynamicViewBinder(
    val onClick: (positon: Int) -> Unit
) : ItemViewBinder<DynamicEmptyItemData, EmptyDynamicViewBinder.ViewHolder>() {

    override fun onCreateViewHolder(
        inflater: LayoutInflater,
        parent: ViewGroup
    ): ViewHolder {
        return ViewHolder(LayoutProfileDynamicEmptyBinding.inflate(inflater, parent, false)).also {
            it.initView()
        }
    }

    @SuppressLint("SetTextI18n")
    override fun onBindViewHolder(
        holder: ViewHolder,
        item: DynamicEmptyItemData
    ) {
    }

    inner class ViewHolder(
        rootBinding: LayoutProfileDynamicEmptyBinding,
    ) : BindingViewHolder<LayoutProfileDynamicEmptyBinding>(rootBinding) {

        fun initView() {
            binding.root.onClick {
                onClick.invoke(layoutPosition)
            }
        }

    }


}
