//
//  VerifiedPopUpVC.swift
//  WoWonder
//
//  Created by iMac on 01/09/23.
//  Copyright © 2023 ScriptSun. All rights reserved.
//

import UIKit

protocol VerifiedPopUpVCDelegate {
    func handleVerifiedTap(verified: String)
}

class VerifiedPopUpVC: UIViewController {
    
    // MARK: - Properties
    
    var delegate: VerifiedPopUpVCDelegate!
    
    // MARK: - View Life Cycles
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
        
        self.initialConfig()
    }
    
    // MARK: - Selectors
    
    // All Button Action
    @IBAction func allButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate.handleVerifiedTap(verified: "All")
        }
    }
    
    // Verified Button Action
    @IBAction func verifiedButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate.handleVerifiedTap(verified: "Verified")
        }
    }
    
    // UnVerified Button Action
    @IBAction func unVerifiedButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate.handleVerifiedTap(verified: "UnVerified")
        }
    }
    
    // Close Button Action
    @IBAction func closeButtonCLick(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate.handleVerifiedTap(verified: "All")
        }
    }
    
    // MARK: - Helper Functions
    
    // Initial Config
    func initialConfig() {
        self.view.backgroundColor = .black.withAlphaComponent(0.4)
    }
    
}
