package com.adealink.weparty.order.refund.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.order.databinding.ItemRefundAddPhotoBinding
import com.adealink.weparty.order.refund.data.AddPhotoItemData


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

    override fun onBindViewHolder(
        holder: ViewHolder,
        item: AddPhotoItemData,
    ) {
        holder.binding.root.onClick {
            onItemClick.invoke()
        }
    }

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

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