//
//  CCBottomMenuCell.swift
//  SwiftProject
//
//  Created by Zhang, Joyce on 2024/2/23.
//

import UIKit

class CCBottomMenuCell: UITableViewCell {
    
    
    lazy var iconImageView: UIImageView = {
        let imageView = UIImageView()
//        imageView.image = UIImage.init(named: "info_step_head_img_default")
//        imageView.layer.cornerRadius = KHZSize(40)
//        imageView.clipsToBounds = true
//        imageView.layer.borderWidth = KHZSize(2)
//        imageView.layer.borderColor = UIColor.white.cgColor
        return imageView
    }()
    
    lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.backgroundColor = UIColor.clear
        label.font = KFont_Medium(14)
        label.textColor = KTextColor_White
        label.text = ""
        return label
    }()
    
    
//    lazy var arrowImageView: UIImageView = {
//        let imageView = UIImageView()
//        imageView.image = UIImage.init(named: "mine_menu_cell_arrow")
//        return imageView
//    }()
    
    //MARK: - init
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        self.backgroundColor = .clear
        
        
//        self.contentView.addSubview(arrowImageView)
        
        let bgView = UIView()
        self.contentView.addSubview(bgView)
        bgView.snp.makeConstraints { make in
            make.top.bottom.equalTo(self)
            make.centerX.equalTo(self)
            
        }
        
        //加载
        bgView.addSubview(titleLabel)
        bgView.addSubview(iconImageView)
        
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalTo(bgView.snp.top)
            make.bottom.equalTo(bgView.snp.bottom)
            make.trailing.equalTo(bgView.snp.trailing)
        }
        
        titleLabel.font = UIFont.systemFont(ofSize: 16)
        
        //布局
        iconImageView.snp.makeConstraints { (make) in
            make.centerY.equalTo(bgView.snp.centerY)
            make.trailing.equalTo(titleLabel.snp.leading).offset(-10)
            make.width.equalTo(32)
            make.height.equalTo(32)
            make.leading.equalTo(bgView.snp.leading)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    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
    }

}
