//
//  TSTBCallPreviewView.swift
//  AIRingtone
//
//  Created by 100Years on 2025/3/2.
//

class TSTBCallPreviewView: TSBaseView {
    
    var closePage:(()->Void)?
    
    var urlString:String?{
        didSet{
            networkImageView.setAsyncImage(urlString: urlString,contentMode: .scaleAspectFill)
        }
    }
    
    var networkImageView = UIImageView()
    lazy var bgImageView : UIImageView = {
        let bgImageView = UIImageView.createImageView(imageName: "them_call_bg")
        return bgImageView
    }()
    
    override func creatUI() {
        self.backgroundColor = .red.withAlphaComponent(0.1)
        addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickView)))
    
        contentView.addSubview(networkImageView)
        networkImageView.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.width.equalTo(k_ScreenWidth)
            make.height.equalTo(kDesignScale*812)
        }
        
        contentView.addSubview(bgImageView)
        bgImageView.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.width.equalTo(k_ScreenWidth)
            make.height.equalTo(kDesignScale*812)
        }
    }
    
    @objc func clickView(){
        isHidden = true
        closePage?()
    }
}
