//
//  TSMineCell.swift
//  TSLiveWallpaper
//
//  Created by 100Years on 2024/12/20.
//

class TSMineCell: TSBaseTabViewCell {

    lazy var leftLab: UILabel = {
        return UILabel.createLabel(font: .font(size: 16),textColor: .white)
    }()
    
    lazy var rightLab: UILabel = {
        return UILabel.createLabel(font: .font(size: 16),textColor: .fromHex("FFFFFF", alpha: 0.4))
    }()
    
    lazy var rightImageView: UIImageView = {
        return UIImageView.createRightArrow()
    }()
    
    var itemModel:TSBasicItemModel = TSBasicItemModel(){
        didSet{
            leftLab.text = itemModel.leftTitle
            rightLab.text = itemModel.rightString
            
            if itemModel.rightIsHave {
                rightImageView.isHidden = false
                rightLab.isHidden = true
            }else{
                rightImageView.isHidden = true
                rightLab.isHidden = false
            }
        }
    }
    
    override func creatUI() {
        bgContentView.cornerRadius = 10
        bgContentView.backgroundColor = UIColor.fromHex("FFFFFF", alpha: 0.1)
        bgContentView.snp.updateConstraints { make in
            make.top.equalTo(16)
        }
        
        bgContentView.addSubview(leftLab)
        bgContentView.addSubview(rightLab)
        bgContentView.addSubview(rightImageView)
        
        leftLab.snp.makeConstraints { make in
            make.leading.equalTo(16)
            make.centerY.equalToSuperview()
        }
        
        rightLab.snp.makeConstraints { make in
            make.trailing.equalTo(-16)
            make.centerY.equalToSuperview()
        }
        
        rightImageView.snp.makeConstraints { make in
            make.trailing.equalTo(-16)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(24)
        }
    }

}
