//
//  Cell_OrderCreatItemHeader.swift
//  VattiCSS
//
//  Created by Jan on 2023/8/30.
//

import UIKit

class Cell_OrderCreatItemHeader: UITableViewCell {
    @IBOutlet weak var bgView: UIView!
    @IBOutlet weak var lab_tip: UILabel!
    @IBOutlet weak var lab_title: UILabel!
    @IBOutlet weak var btn_delete: UIButton!
    
    var callBack: TCRowCallBack?
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    @IBAction func deleteAction(_ sender: UIButton) {
        callBack?(0)
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}


extension Cell_OrderCreatItemHeader: TCCell_RowCellUpdateProtocol {

    typealias DataSource = (String,Bool)
    typealias ConfigModel = TCFormCellConfigModel
    
    func row_update(callBack block: TCRowCallBack?) {
        callBack = block
    }
    
    func row_update(config data: TCFormCellConfigModel) {
      
    }
    
    func row_update(dataSource data: (String,Bool)) {
        lab_title.text = data.0
        btn_delete.isHidden = !data.1
    }
    
}
