//
//  CWMutiSelectOpeateView.swift
//  ColorfulWallpaper
//
//  Created by nkl on 2024/9/23.
//

import Foundation
import UIKit

class CWMutiSelectOpeateView: UIView {
    lazy var hStack: UIStackView = {
        let stack: UIStackView = .hStack
        stack.distribution = .fillEqually
        return stack
    }()

    lazy var deleteButton: CWOperateButton = .init(title: "Delete".localized(), imgName: "ic_delete")
    lazy var addPlaylist: CWOperateButton = .init(title: "Add to Playlist".localized(), imgName: "ic_multi_addPlaylist")

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .hexColor("#262626")
        addChildren()
        makeConstraints()
    }

    func addChildren() {
        addSubview(hStack)
        hStack.addArrangedSubview(deleteButton)
        hStack.addArrangedSubview(addPlaylist)
    }

    func makeConstraints() {
        hStack.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(20)
            make.leading.trailing.equalToSuperview()
        }
    }

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