package com.example.chemical.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.chemical.R
import com.rc.httpcore.bean.ChemicalSearchBean

class DcaeDialogAdapter :
    BaseQuickAdapter<ChemicalSearchBean, BaseViewHolder>(R.layout.chemical_search_rv) {
    override fun convert(holder: BaseViewHolder, item: ChemicalSearchBean) {
        holder.setText(R.id.chemicalName, "${item.chemicalName}")
        if (item.casNum != null) {
            holder.setText(R.id.casNum, "${item.casNum}")
        }
        if (item.chemicalPurity != null) {
            holder.setText(R.id.chemicalPurity, "${item.chemicalPurity}")
        }
    }
}