//
//  LNHomeActivityMoreTabView.swift
//  Gami
//
//  Created by OneeChan on 2026/1/18.
//

import Foundation
import UIKit
import SnapKit


class LNHomeActivityMoreTabView: UIView {
    private let cover = UIImageView()
    private let nameLabel = UILabel()
    private let selectedIc = UIImageView()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupViews()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

extension LNHomeActivityMoreTabView {
    private func setupViews() {
        selectedIc.image = .icHomeActivityTab
        addSubview(selectedIc)
        selectedIc.snp.makeConstraints { make in
            make.leading.equalToSuperview()
            make.verticalEdges.equalToSuperview()
        }
        
        cover.image = .init(named: "ic_home_game_tab_more")
        addSubview(cover)
        cover.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.trailing.equalToSuperview()
            make.trailing.equalTo(selectedIc.snp.trailing).offset(3)
        }
        
        nameLabel.text = .init(key: "A00048")
        nameLabel.textAlignment = .center
        nameLabel.font = .body_s
        nameLabel.textColor = .text_5
        nameLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
        nameLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
        addSubview(nameLabel)
        nameLabel.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.leading.equalToSuperview().offset(9)
            make.trailing.lessThanOrEqualTo(cover.snp.leading)
        }
    }
}

