//
//  RelateSeachCell.swift
//  ColorfulWallpaper
//
//  Created by nkl on 2024/9/11.
//

import Foundation
import UIKit

class RelateSeachCell : UITableViewCell {
    
    lazy var searchIcon : UIImageView = UIImageView.init(image: .iconSearch)
    
    lazy var keywordLabel : UILabel = {
       let lab = UILabel()
        lab.textColor = .white
        return lab
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        backgroundColor = .clear
        selectionStyle = .none
        addChildren()
        makeConstraints()
    }

    func addChildren(){
        contentView.addSubview(searchIcon)
        contentView.addSubview(keywordLabel)
    }
    
    func makeConstraints(){
        searchIcon.snp.makeConstraints { make in
            make.width.height.equalTo(16)
            make.leading.equalToSuperview().offset(16)
            make.centerY.equalToSuperview()
        }
        keywordLabel.snp.makeConstraints { make in
            make.leading.equalTo(searchIcon.snp.trailing).offset(12)
            make.trailing.equalToSuperview().inset(16)
            make.verticalEdges.equalToSuperview().inset(10)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
