Files
puter/src/UI/UIComponentWindow.js
T
2024-05-06 16:44:23 -04:00

27 lines
612 B
JavaScript

import UIWindow from './UIWindow.js'
import Placeholder from "../util/Placeholder.js"
/**
* @typedef {Object} UIComponentWindowOptions
* @property {Component} A component to render in the window
*/
/**
* Render a UIWindow that contains an instance of Component
* @param {UIComponentWindowOptions} options
*/
export default async function UIComponentWindow (options) {
const placeholder = Placeholder();
const win = await UIWindow({
...options,
body_content: placeholder.html,
});
options.component.attach(placeholder);
options.component.focus();
return win;
}