import UIKit

/// members registration table view cell
class RegistraceMembersTableViewCell: UITableViewCell {
    
    public let title: UILabel = {
        let view = UILabel()
        view.numberOfLines = 0
        view.textColor = .black
        view.textAlignment = .left
        view.translatesAutoresizingMaskIntoConstraints = false
        return view
    }()
    
    public let firstSubtitle: UILabel = {
        let view = UILabel()
        view.numberOfLines = 0
        view.textColor = .gray
        view.textAlignment = .center
        view.translatesAutoresizingMaskIntoConstraints = false
        return view
    }()
    
    public let secondSubtitle: UILabel = {
        let view = UILabel()
        view.numberOfLines = 0
        view.textColor = .gray
        view.textAlignment = .center
        view.translatesAutoresizingMaskIntoConstraints = false
        return view
    }()
    
    static let cellIdentifier: String = "RegistraceMembersTableViewCellIdentifier"
    
    /// initialization function
    /// - Parameters:
    ///   - style: style for cell
    ///   - reuseIdentifier: reuse indetifier for cell
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        addSubview(title)
        addSubview(firstSubtitle)
        addSubview(secondSubtitle)
        NSLayoutConstraint.activate([
            title.centerYAnchor.constraint(equalTo: centerYAnchor),
            title.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 12),
            title.trailingAnchor.constraint(equalTo: firstSubtitle.trailingAnchor, constant: 8),
            
            firstSubtitle.centerYAnchor.constraint(equalTo: centerYAnchor),
            firstSubtitle.trailingAnchor.constraint(equalTo: secondSubtitle.trailingAnchor, constant: -30),
            
            secondSubtitle.centerYAnchor.constraint(equalTo: centerYAnchor),
            secondSubtitle.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -12),
        ])
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
