//
//  TitleAndSubTitleView.swift

//
//  Created by Leon on 2025/7/28.
//

class TitleAndSubTitleView: UIView{
    var titleLabel:UILabel!
    var subLabel:LineSpaceLabel!
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupViews(){
        titleLabel = {
            let label = UILabel()
            label.font = .t.tll
            label.textColor = .text
            label.textAlignment = .left
            addSubview(label)
            label.snp.makeConstraints { make in
                make.left.equalToSuperview()
                make.top.equalToSuperview()
                make.right.equalToSuperview()
                //make.height.equalTo(24)
            }
            return label
        }()
        subLabel = {
            let label = LineSpaceLabel()
            let typo = CLSystemToken.typography(token: .tbl)
            label.config(typo)
            label.textColor = .text
            label.textAlignment = .left
            addSubview(label)
            label.snp.makeConstraints { make in
                make.left.equalToSuperview()
                make.top.equalTo(titleLabel.snp.bottom).offset(12)
                make.right.equalToSuperview()
                make.bottom.equalToSuperview()
            }
            return label
        }()
    }
}
