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

import UIKit

protocol TwoFactorStatusAlertVCDelegate {
    func getTwoFactorStatusString(type: String)
}

class TwoFactorStatusAlertVC: UIViewController {
    
    // MARK: - Properties

    var delegate: TwoFactorStatusAlertVCDelegate?
    
    // MARK: - View Life Cycles
    
    override func viewDidLoad() {
        super.viewDidLoad()

        self.initialConfig()
    }
    
    // MARK: - Selectors
    
    // Disable Button Action
    @IBAction func disableButtonAction(_ sender: UIButton) {
        self.dismiss(animated: true) {
            self.delegate?.getTwoFactorStatusString(type: "off")
        }
    }
    
    // Enable Button Action
    @IBAction func enableButtonAction(_ sender: UIButton) {
        self.dismiss(animated: true) {
            self.delegate?.getTwoFactorStatusString(type: "on")
        }
    }
    
    // Close Button Action
    @IBAction func closeButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true, completion: nil)
    }
    
    // MARK: - Helper Functions
    
    // Initial Config
    func initialConfig() {
        self.view.backgroundColor = .black.withAlphaComponent(0.4)
    }
    
}
