//
//  LinkCollectionViewCell.swift
//  MobileFirstFramework
//
//  Created by Lekshmi S on 15/12/20.
//  Copyright © 2020 Verizon Wireless. All rights reserved.
//
import MVMCoreUI

open class LinkCollectionViewCell: CollectionViewCell {
    public let link = Link()
    
    open override func setupView() {
        super.setupView()
        isAccessibilityElement = true
        addMolecule(link)
        MVMCoreUIUtility.setMarginsFor(contentView, leading: 0, top: 0, trailing: 0, bottom: 0)
    }
    
    open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
        guard let model = model as? LinkModel else { return }
        link.set(with: model, delegateObject, additionalData)
        updateAccessibility()
    }
    
    open func updateAccessibility() {
        accessibilityLabel = link.accessibilityLabel
        accessibilityHint = link.accessibilityHint
        accessibilityTraits = link.accessibilityTraits
    }
}

