//
//  CDView.swift
//  PhysicalWallPaper
//
//  Created by nkl on 2024/11/22.
//

import Foundation
import UIKit

class CDView: UIView {
    lazy var bgImageView: UIImageView = .simpleImage(imageName: "ic_vinly")
    lazy var icImageView: UIImageView = .simpleImage(imageName: "ic_default")

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

    func addChildren() {
        addSubview(bgImageView)
        addSubview(icImageView)
        icImageView.layer.cornerRadius = 19
        icImageView.layer.masksToBounds = true
    }

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

        icImageView.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.width.height.equalTo(38)
        }
    }

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