//
//  UserProfileMenuAlertVC.swift
//  WoWonder
//
//  Created by UnikApp on 24/02/23.
//  Copyright © 2023 ScriptSun. All rights reserved.
//

import UIKit
import Async
import WowonderMessengerSDK

protocol UserProfileMenuAlertVCDelegate {
    func handleBlockButtonTap(_ sender: UIButton)
    func handleShareButtonTap(_ sender: UIButton)
}

class UserProfileMenuAlertVC: BaseVC {
    
    // MARK: - IBOutlets
    
    @IBOutlet weak var blockView: UIView!
    @IBOutlet weak var blockLabel: UILabel!
    
    // MARK: - Properties
    
    var is_blocked = false
    var delegate: UserProfileMenuAlertVCDelegate?
    
    // MARK: - View Life Cycles

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        self.initialConfig()
    }
    
    //MARK: - All Action
    
    // Block Button Action
    @IBAction func blockButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate?.handleBlockButtonTap(sender)
        }
    }
    
    @IBAction func shareButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate?.handleShareButtonTap(sender)
        }
    }
    
    // Close Button Action
    @IBAction func closeButtonCLick(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true)
    }
    
    // Initial Config
    func initialConfig() {
        self.view.backgroundColor = .black.withAlphaComponent(0.4)
        self.blockLabel.text = self.is_blocked ? "UnBlock" : "Block"
    }
    
}
