//
//  MessageView.swift
//  OrderScheduling
//
//  Created by 中道 on 2023/8/18.
//

import Foundation
import DDControlsKit_Private
import DDAutoUIKit_Private
import DDColorKit_Private
import SnapKit

class MessageView : DDView {
    public let titleLabel : DDLabel
    public let countLabel : DDLabel
    override init(frame: CGRect) {
        titleLabel = DDLabel.dd_init(withText: "", font: .mediumFont(auto(14)), textColor: .white.alpha(0.7))
        countLabel = DDLabel.dd_init(withText: "", font: .regularFont(auto(12)), textColor: .white)
        super.init(frame: frame)
        
        titleLabel.textAlignment = .center
        addSubview(titleLabel)
        countLabel.layer.cornerRadius = 10
        countLabel.layer.masksToBounds = true
        countLabel.textAlignment = .center
        countLabel.backgroundColor = .red
        countLabel.text = "99"
        addSubview(countLabel)
        
        titleLabel.snp.makeConstraints { make in
            make.left.top.bottom.equalToSuperview()
            make.width.greaterThanOrEqualTo(30)
        }
        countLabel.snp.makeConstraints { make in
            make.left.equalTo(titleLabel.snp.right)
            make.centerY.equalToSuperview()
            make.width.equalTo(0)
            make.height.equalTo(20)
            make.right.equalToSuperview()
        }
    }
    
    public required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
