//
//  GuideBubbleView.swift
//  PhysicalWallPaper
//
//  Created by nkl on 2024/12/17.
//

import Foundation
import UIKit

class GuideBubbleView: UIControl {
    
    lazy var titleLabel: UILabel = {
        let lab = UILabel()
        lab.textColor = .white
        lab.font = .systemFont(ofSize: 16)
        lab.text = "Find your favorite songs".localized()
        return lab
    }()
    
    lazy var bgView: UIImageView = .init(image: UIImage.init(named: "ic_bubble_bg"))
    
    lazy var tapArea : UIControl = UIControl()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        addChildren()
        makeConstraints()
    }
    
    func addChildren(){
        addSubview(bgView)
        bgView.addSubview(titleLabel)
        addSubview(tapArea)
    }
    
    func makeConstraints(){
        bgView.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(safeAreaLayoutGuide.snp.top).offset(84)
        }
        
        titleLabel.snp.makeConstraints { make in
            make.horizontalEdges.equalToSuperview().inset(12)
            make.centerY.equalToSuperview()
        }
        
        tapArea.snp.makeConstraints { make in
            make.top.leading.trailing.equalToSuperview()
            make.bottom.equalTo(bgView)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
