//
//  CameraAlertVC.swift
//  WoWonder
//
//  Created by iMac on 24/08/23.
//  Copyright © 2023 ScriptSun. All rights reserved.
//

import UIKit

enum ImagePickerMediaType {
    case IMAGE
    case VIDEO
}

protocol CameraAlertVCDelegate {
    func handleTakePictureFromCameraTap(_ sender: UIButton)
    func handleRecordVideoFromCameraTap(_ sender: UIButton)
}

class CameraAlertVC: UIViewController {
    
    // MARK: - Properties
    
    var delegate: CameraAlertVCDelegate?
    
    // MARK: - View Life Cycles

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        self.initialConfig()
    }
    
    //MARK: - All Action
    
    // Take Picture Button Action
    @IBAction func takePictureButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate?.handleTakePictureFromCameraTap(sender)
        }
    }
    
    // Record Video Button Action
    @IBAction func recordVideoButtonAction(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true) {
            self.delegate?.handleRecordVideoFromCameraTap(sender)
        }
    }
    
    // Close Button Action
    @IBAction func closeButtonCLick(_ sender: UIButton) {
        self.view.endEditing(true)
        self.dismiss(animated: true)
    }
    
    // MARK: - Helper Functions
    
    // Initial Config
    func initialConfig() {
        self.view.backgroundColor = .black.withAlphaComponent(0.4)
    }

}
