//
//  TSBigIconBrowseCell.swift
//  AIEmoji
//
//  Created by 100Years on 2025/2/20.
//


class TSBigIconBrowseCell : TSBaseCollectionCell{

    lazy var netWorkImageView : UIImageView = {
        let netWorkImageView = UIImageView.createImageView(imageName: "",corner: 24.0)
        return netWorkImageView
    }()

    lazy var textLabel: UILabel = {
        let textLabel = UILabel.createLabel(
            font: .font(size: 12),
            textColor: .white,
            numberOfLines: 0
        )
        return textLabel
    }()
    

    lazy var vipImageView: UIImageView = {
        let vipImageView = UIImageView.createImageView(imageName:"vip_side_icon")
        vipImageView.contentMode = .scaleToFill
        vipImageView.isHidden = true
        return vipImageView
    }()

    override func creatUI() {
        let w = k_ScreenWidth - 120
        let h = w/kTextWHScale
        bgContentView.addSubview(netWorkImageView)
        netWorkImageView.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(0)
            make.width.equalTo(w)
            make.height.equalTo(h)
        }
        
        let labelBgView = UIView()
        labelBgView.backgroundColor = "#333333".uiColor
        labelBgView.cornerRadius = 16.0
        labelBgView.addSubview(textLabel)
        textLabel.snp.makeConstraints { make in
            make.top.leading.equalTo(12)
            make.trailing.bottom.equalTo(-12)
        }
        
        bgContentView.addSubview(labelBgView)
        labelBgView.snp.makeConstraints { make in
            make.top.equalTo(netWorkImageView.snp.bottom).offset(20)
            make.centerX.equalToSuperview()
            make.leading.greaterThanOrEqualTo(16)
            make.trailing.lessThanOrEqualTo(-16)
            make.bottom.lessThanOrEqualTo(0)
        }
        
        netWorkImageView.addSubview(vipImageView)
        vipImageView.snp.makeConstraints { make in
            make.width.height.equalTo(40)
            make.top.equalTo(-5)
            make.trailing.equalTo(5)
        }
        
    }
}
