//
//  LNPostShareSkillItemView.swift
//  Lanu
//
//  Created by OneeChan on 2025/12/16.
//
import Foundation
import UIKit
import SnapKit


class LNPostShareSkillItemView: UIView {
    let icon = UIImageView()
    let nameLabel = UILabel()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        let bg = UIImageView()
        bg.image = .primary_7
        bg.layer.cornerRadius = 26
        bg.clipsToBounds = true
        addSubview(bg)
        bg.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview()
            make.width.height.equalTo(52)
        }
        
        icon.backgroundColor = .fill
        icon.layer.cornerRadius = 25.5
        icon.clipsToBounds = true
        addSubview(icon)
        icon.snp.makeConstraints { make in
            make.center.equalTo(bg)
            make.width.height.equalTo(bg).inset(1)
        }
        
        let nameBg = UIImageView()
        nameBg.image = .primary_7
        nameBg.layer.cornerRadius = 10.5
        nameBg.clipsToBounds = true
        addSubview(nameBg)
        nameBg.snp.makeConstraints { make in
            make.horizontalEdges.equalToSuperview()
            make.bottom.equalToSuperview()
            make.top.equalTo(bg.snp.bottom).offset(-9)
            make.height.equalTo(21)
            make.width.equalTo(67)
        }
        
        nameLabel.font = .body_xs
        nameLabel.textColor = .text_1
        nameLabel.textAlignment = .center
        nameBg.addSubview(nameLabel)
        nameLabel.snp.makeConstraints { make in
            make.center.equalToSuperview()
            make.horizontalEdges.equalToSuperview().inset(6)
        }
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
}
