/*
 * Copyright 2023 VMware, Inc. All rights reserved. VMware Confidential
 */

import { Component, ElementRef, Input, OnInit } from "@angular/core";
import { SafeHtml } from "@angular/platform-browser";
import { ExtensionComponentRegistration } from "./extension-component.registry";

@Component({
    selector: "vcd-extension-application-custom-elements-container",
    templateUrl: "./extension-application-custom-elements-container.component.html",
})
export class ExtensionApplicationCustomElementsContainerComponent implements OnInit {
    @Input()
    angularApp: ExtensionComponentRegistration;

    @Input()
    html: SafeHtml;

    constructor(private elRef: ElementRef) {}

    ngOnInit(): void {
        this.elRef.nativeElement.customElements = this.angularApp.angularAppDetails.angularAppBundle.customWindow[
            "customElements"
        ];
    }
}
