//
//  Cell_FinishFeeSelect.swift
//  VattiCSS
//
//  Created by Jan on 2023/12/28.
//

import UIKit

class Cell_FinishFeeSelect: UITableViewCell {
    @IBOutlet weak var bgView: UIView!
    @IBOutlet weak var btn_icon: UIButton!
    @IBOutlet weak var lab_name: UILabel!
    @IBOutlet weak var lab_code: UILabel!
    @IBOutlet weak var btn_state: UIButton!
    
    var callBack: TCRowCallBack?
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    
    @IBAction func seleteAtion(_ sender: UIButton) {
        callBack?("")
    }
    
    
    @IBAction func seleteAction(_ sender: UIButton) {
        callBack?("")
    }
    
}


extension Cell_FinishFeeSelect: TCCell_RowCellUpdateProtocol {

    typealias DataSource = (String,String,String,Bool)
    typealias ConfigModel = TCFormCellConfigModel
    
    func row_update(config data: TCFormCellConfigModel) {
      
    }
    
    func row_update(dataSource data: (String,String,String,Bool)) {
        lab_name.text = data.0
        lab_code.text = data.1
        btn_icon.sd_setImage(with: URL(string: data.2), for: .normal, placeholderImage: UIImage(named: "parts_default"), context: nil)
        
        let image = UIImage(named: data.3==true ? "hep_radiobox_selected" : "hep_radiobox_normal")
        btn_state.setImage(image, for: .normal)
    }
    
    func row_update(callBack block: TCRowCallBack?) {
        callBack = block
    }
    
}
