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

import android.view.LayoutInflater
import android.view.ViewGroup
import com.adealink.weparty.commonui.recycleview.adapter.BindingViewHolder
import com.adealink.weparty.commonui.recycleview.adapter.multitype.ItemViewBinder
import com.adealink.weparty.module.profile.data.UserInterest
import com.adealink.weparty.profile.databinding.LayoutProfileInterestItemBinding

data class ProfileInterestItemData(
    val interest: UserInterest
)

class ProfileInterestViewBinder :
    ItemViewBinder<ProfileInterestItemData, BindingViewHolder<LayoutProfileInterestItemBinding>>() {

    override fun onBindViewHolder(
        holder: BindingViewHolder<LayoutProfileInterestItemBinding>,
        item: ProfileInterestItemData,
    ) {
        holder.binding.root.text = item.interest.name
    }

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

}