// #region Imports
import { directive, Directive } from 'lit/directive.js';
import { html } from '../Dom/Html';
import { DataTemplateRegistry } from './DataTemplates/DataTemplateRegistry';
// #endregion
/**
 * A directive that inserts a registered template into the DOM.
 *
 * @public
 */
export class TemplateDirective extends Directive {
    // #region Methods
    render(templateId) {
        const template = DataTemplateRegistry.instance.getTemplate(templateId);
        if (!template) {
            console.error(`Template with ID '${templateId}' not found.`);
            return html.nothing; // Render nothing if not found
        }
        return html `${document.importNode(template.content, true)}`;
    }
}
export const template = directive(TemplateDirective);
//# sourceMappingURL=TemplateDirective.js.map