//
//  TSRingDownNullView.swift
//  AIRingtone
//
//  Created by 100Years on 2025/3/18.
//

class TSRingDownNullView: TSBaseView {
    var clickBlock:()->Void
    
    init(clickBlock: @escaping () -> Void) {
        self.clickBlock = clickBlock
        super.init(frame: .zero)
    }
    
    @MainActor required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var imageView: UIImageView = {
        return UIImageView.createImageView(imageName: "ring_null")
    }()
    
    lazy var titleLabel: UILabel = {
        let titleLabel = UILabel.createLabel(text:"No Ringtone".localized ,font:.font(size: 14.0),textColor: .white,textAlignment: .center,numberOfLines: 0)
        return titleLabel
    }()
    
    lazy var submitBtn: UIButton = {
        let button = kCreateNormalSubmitBtn(title: "Explore".localized, frame: CGRectMake(0, 0, 200, 48),action: { [weak self]  in
            guard let self = self else { return }
            clickBlock()
        })
        return button
    }()

    override func creatUI() {
        
        self.frame = CGRectMake(0, 0, k_ScreenWidth, k_ScreenHeight - k_Nav_Height)
        
        contentView.addSubview(imageView)
        imageView.snp.makeConstraints { make in
            make.top.equalTo(112)
            make.centerX.equalToSuperview()
            make.width.height.equalTo(120)
        }

        contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.top.equalTo(imageView.snp.bottom).offset(4)
            make.leading.equalTo(16)
            make.trailing.equalTo(-16)
            make.height.equalTo(20)
        }
        
        contentView.addSubview(submitBtn)
        submitBtn.snp.makeConstraints { make in
            make.top.equalTo(titleLabel.snp.bottom).offset(40)
            make.centerX.equalToSuperview()
            make.width.equalTo(submitBtn.width)
            make.height.equalTo(submitBtn.height)
        }

    }
    
}
