//
//  ActionTopNotificationHandler.swift
//  MVMCoreUI
//
//  Created by Scott Pfeil on 7/16/22.
//  Copyright © 2022 Verizon Wireless. All rights reserved.
//

import Foundation
import MVMCore

/// Shows a top notification/alert with the model.
open class ActionTopNotificationHandler: MVMCoreActionHandlerProtocol {
    required public init() {}
    
    open func execute(with model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws {
        guard let model = model as? ActionTopNotificationModel else { return }
        try await NotificationHandler.shared()?.showNotification(for: model.topNotification, delegateObject: delegateObject as? MVMCoreUIDelegateObject)
    }
}
