package com.adealink.weparty.setting.helpcenter.adapter

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.setting.databinding.ItemSettingHelpAddPictureBinding
import com.adealink.weparty.setting.helpcenter.data.AddPictureItemData


class AddPictureItemViewBinder(
    val onItemClick: () -> Unit,
) :
    ItemViewBinder<AddPictureItemData, BindingViewHolder<ItemSettingHelpAddPictureBinding>>() {

    override fun onBindViewHolder(
        holder: BindingViewHolder<ItemSettingHelpAddPictureBinding>,
        item: AddPictureItemData,
    ) {
        holder.binding.root.onClick {
            onItemClick.invoke()
        }
    }

    override fun onCreateViewHolder(
        inflater: LayoutInflater,
        parent: ViewGroup,
    ): BindingViewHolder<ItemSettingHelpAddPictureBinding> {
        return BindingViewHolder(
            ItemSettingHelpAddPictureBinding.inflate(
                inflater,
                parent,
                false
            )
        )
    }
}