package com.tanya.careerguidanceproject

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
//import com.tanya.careerguidanceproject.activities.CourseRecyclerAdapter
import com.tanya.careerguidanceproject.model.Career
//import com.tanya.careerguidanceproject.model.College
//import com.tanya.careerguidanceproject.model.Course

class CareerRecyclerAdapter (val context : Context, private val careerInfoList : ArrayList<Career>) : RecyclerView.Adapter<CareerRecyclerAdapter.DashboardViewHolder> (){
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DashboardViewHolder {
        val view = LayoutInflater.from(parent.context).inflate(R.layout.career_rv_item, parent, false)

        return DashboardViewHolder(view)
    }

    override fun getItemCount(): Int {
        return careerInfoList.size
    }

    override fun onBindViewHolder(holder: DashboardViewHolder, position: Int) {
        val modal = careerInfoList[position]
        holder.topic.text = modal.topic
        holder.type.text = modal.type
        holder.details.text = modal.details

    }
    class DashboardViewHolder(view: View) : RecyclerView.ViewHolder(view){
        val topic : TextView = view.findViewById(R.id.txtCareerTopic)
        val type : TextView = view.findViewById(R.id.txtCareerType)
        val details : TextView = view.findViewById(R.id.txtDetails)

    }
}