//
//  PlayListTopItemView.swift
//  TSLiveWallpaper
//
//  Created by nkl on 2024/12/26.
//

import Foundation

class PlayListTopItemView: UIControl {
    lazy var bgImageView: UIImageView = .simpleImage(imageName: "")
    lazy var vStack: UIStackView = .vStack
    lazy var titleLabel: UILabel = .simpleLabel(text: "--", font: .font(size: 18))
    lazy var countLabel: UILabel = .simpleLabel(text: "--", font: .font(size: 18))

    override init(frame: CGRect) {
        super.init(frame: frame)
        addChildren()
        makeConstraints()
    }

    func addChildren() {
        addSubview(bgImageView)
        bgImageView.addSubview(vStack)
        vStack.addArrangedSubview(titleLabel)
        vStack.addArrangedSubview(countLabel)
    }

    func makeConstraints() {
        bgImageView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }

        vStack.snp.makeConstraints { make in
            make.horizontalEdges.equalToSuperview().inset(12)
            make.verticalEdges.equalToSuperview().inset(12)
        }
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
