mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-09 15:51:32 +00:00
27 lines
612 B
JavaScript
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;
|
|
}
|