//
//  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 textBtn: UIButton = {
        let textBtn = UIButton.createButton(
            backgroundColor: "#333333".uiColor,
            font: .font(size: 12),
            titleColor: .white,
            corner: 16
        )
        textBtn.contentEdgeInsets = UIEdgeInsets(top: 12, left: 12, bottom: 12, right: 12)
        return textBtn
    }()
    
    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)
        }
        
        bgContentView.addSubview(textBtn)
        textBtn.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)
        }
        
    }
}
