//
//  TitleLockup.swift
//  MVMCoreUI
//
//  Created by Nadigadda, Sumanth on 04/05/22.
//  Copyright © 2022 Verizon Wireless. All rights reserved.
//
import VDS

@objcMembers open class TitleLockup: VDS.TitleLockup, VDSMoleculeViewProtocol {

    //--------------------------------------------------
    // MARK: - Public Properties
    //--------------------------------------------------
    open var viewModel: TitleLockupModel!
    open var delegateObject: MVMCoreUIDelegateObject?
    open var additionalData: [AnyHashable : Any]?
    
    //--------------------------------------------------
    // MARK: - Public Functions
    //--------------------------------------------------
    open func viewModelDidUpdate() {
        surface = viewModel.surface
        textAlignment = viewModel.textAlignment
        eyebrowModel = viewModel.eyebrowModel(delegateObject: delegateObject, additionalData: additionalData)
        titleModel = viewModel.titleModel(delegateObject: delegateObject, additionalData: additionalData)
        subTitleModel = viewModel.subTitleModel(delegateObject: delegateObject, additionalData: additionalData)
    }

    //--------------------------------------------------
    // MARK: - Initialization
    //--------------------------------------------------
    
    public convenience required init() {
        self.init(frame: .zero)
    }
    
    //--------------------------------------------------
    // MARK: - MoleculeViewProtocol
    //--------------------------------------------------
    open class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
        return 65
    }
    
    open func updateView(_ size: CGFloat) {}    
}

