package com.adealink.weparty.profile.dynamic.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.profile.databinding.ItemPublishDynamicAddPhotoBinding
import com.adealink.weparty.profile.edit.data.AddPhotoItemData


class AddPhotoItemViewBinder(
    val onItemClick: () -> Unit,
) :
    ItemViewBinder<AddPhotoItemData, AddPhotoItemViewBinder.ViewHolder>() {

    override fun onBindViewHolder(
        holder: ViewHolder,
        item: AddPhotoItemData,
    ) {
        holder.binding.root.onClick {
            onItemClick.invoke()
        }
//        holder.binding.tvAddDesc.text = item.getPhotoDesc(holder.layoutPosition)
    }

    override fun onCreateViewHolder(
        inflater: LayoutInflater,
        parent: ViewGroup,
    ): ViewHolder {
        return ViewHolder(
            ItemPublishDynamicAddPhotoBinding.inflate(
                inflater,
                parent,
                false
            )
        )
    }

    class ViewHolder(
        rootBinding: ItemPublishDynamicAddPhotoBinding,
    ) : BindingViewHolder<ItemPublishDynamicAddPhotoBinding>(rootBinding)
}