//
//  SessionPureBgOperateView.swift

//
//  Created by Leon on 2025/9/22.
//

class SessionPureBgOperateView: UIView{
    var block: UIView!
    var backButton: EPIconTertiaryDarkButton!
    var shareButton: EPIconTertiaryDarkButton!
    var middleButton: StyleButton!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupViews() {
        block = {
            let v = UIView()
            addSubview(v)
            v.snp.makeConstraints { make in
                make.bottom.equalToSuperview().offset(-UIWindow.safeAreaBottom)
                make.leading.trailing.equalToSuperview()
                make.top.equalToSuperview()
                make.height.equalTo(80)
            }
            return v
        }()
        
        backButton = {
            
            let v = EPIconTertiaryDarkButton(radius: .round, iconSize: .large, iconCode: .arrowLeftBorder)
            let size = v.bgImageSize()
            block.addSubview(v)
            v.snp.makeConstraints { make in
                make.leading.equalToSuperview().offset(CGFloat.lrs)
                make.centerY.equalToSuperview()
                make.size.equalTo(size)
            }
            return v
        }()
        
        shareButton = {
            let v = EPIconTertiaryDarkButton(radius: .round, iconSize: .large, iconCode: .shareBorder)
            let size = v.bgImageSize()
            block.addSubview(v)
            v.snp.makeConstraints { make in
                make.trailing.equalToSuperview().offset(-CGFloat.lrs)
                make.centerY.equalToSuperview()
                make.size.equalTo(size)
            }
            return v
        }()
        
        middleButton = {
            let v = StyleButton()
            v.contrastTertiaryDark(size: .large)
            block.addSubview(v)
            v.snp.makeConstraints { make in
                make.centerY.equalToSuperview()
                make.leading.equalTo(backButton.snp.trailing).offset(16)
                make.trailing.equalTo(shareButton.snp.leading).offset(-16)
            }
            return v
        }()
        middleButton.setTitle("Chat Background", for: .normal)
    }
}
