package com.adealink.weparty.ui.category.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.databinding.LayoutCategoryItemTitleBinding
import com.adealink.weparty.ui.category.data.CategoryListTitleData

class CategoryListTitleViewBinder :
    ItemViewBinder<CategoryListTitleData, BindingViewHolder<LayoutCategoryItemTitleBinding>>() {

    override fun onBindViewHolder(
        holder: BindingViewHolder<LayoutCategoryItemTitleBinding>,
        item: CategoryListTitleData,
    ) {
        holder.binding.tvTitle.text = item.data.name
    }

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