//
//  YHFormTitleCell.swift
//  galaxy
//
//  Created by edy on 2024/1/22.
//  Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//

import UIKit

class YHFormTitleCell: UITableViewCell {

    static let cellReuseIdentifier = "YHFormTitleCell"

    lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.textColor = UIColor(hexString:"#333333")
        label.textAlignment = .left
        label.numberOfLines = 0
        label.font = UIFont.PFSCR(ofSize: 20)
        return label
    }()
    
    lazy var subTitleLabel: UILabel = {
        let label = UILabel()
        label.textColor = UIColor(hexString:"#888F98")
        label.textAlignment = .left
        label.numberOfLines = 0
        label.font = UIFont.PFSCR(ofSize: 15)
        return label
    }()
    
    lazy var bottomLineView:UIView = {
        let view = UIView()
        view.backgroundColor = UIColor(hex: 0xF0F0F0)
        return view
    }()
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setupUI()
    }
    
    func setupUI() {
        
        self.selectionStyle = .none
        contentView.addSubview(titleLabel)
        contentView.addSubview(subTitleLabel)
        contentView.addSubview(bottomLineView)
        
        titleLabel.text = "配偶"
        subTitleLabel.text = " (如未婚、离婚、丧偶可不填）"
        
        titleLabel.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(16)
            make.right.equalTo(subTitleLabel.snp.left).offset(-3)
            make.centerY.equalToSuperview()
        }
        
        subTitleLabel.snp.makeConstraints { make in
            make.right.equalToSuperview().offset(-16)
            make.centerY.equalToSuperview()
        }
        
        bottomLineView.snp.makeConstraints { make in
            make.left.right.bottom.equalToSuperview()
            make.height.equalTo(1.0)
        }
    }
}
