//
//  Cell_FinishFeesSmallCategory.swift
//  VattiCSS
//
//  Created by WZR on 2024/1/4.
//

import UIKit

class Cell_FinishFeesSmallCategory: UITableViewCell {
    @IBOutlet weak var lab_title: UILabel!
    @IBOutlet weak var img_arrow: UIImageView!
    @IBOutlet weak var view_bg: UIView!
    
    var corner:(UIRectCorner, CGFloat) = ([],0)
    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
    }
    
    override func draw(_ rect: CGRect) {
        super.draw(rect)
        view_bg.makeRadius(value: corner.1, type: corner.0)
    }
}
extension Cell_FinishFeesSmallCategory: TCCell_RowCellUpdateProtocol {
    typealias DataSource = (String, Bool)
    typealias ConfigModel = (UIRectCorner, CGFloat)
    
    func row_update(dataSource data: DataSource) {
        lab_title.cd.text(data.0)
        img_arrow.cd.image(data.1 ? UIImage(named: "fee_arrow_hide") : UIImage(named: "fee_arrow_show"))
    }
    
    func row_update(config data: ConfigModel) {
        corner = data
        view_bg.makeRadius(value: corner.1, type: corner.0)
    }
}
