package app.furmeet.events.system.legal

import android.view.ViewGroup
import app.furmeet.events.system.helper.inflate
import app.furmeet.events.system.helper.layoutInflater
import app.furmeet.events.system.schedule.adapters.RecyclerViewAdapter
import app.furmeet.events.system.schedule.viewHolders.RecyclerViewHolder
import app.furmeet.events.bff.R
import app.furmeet.events.bff.databinding.ActivitySoftwareLicensesItemBinding


class SoftwareLicensesAdapter(private val licenses: List<SoftwareLicense>) : RecyclerViewAdapter() {
    override fun getItemCount(): Int =
        licenses.size

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerViewHolder =
        RecyclerViewHolder(parent.context.layoutInflater.inflate(R.layout.activity_software_licenses_item))

    override fun onBindViewHolder(holder: RecyclerViewHolder, position: Int) {
        val view = holder.itemView
        val binding = ActivitySoftwareLicensesItemBinding.bind(view)
        binding.software.text = licenses[position].software
        binding.license.text = licenses[position].license
    }

}
