chore: complete update
This commit is contained in:
23
resources/js/modules/ui/UIManager.js
Normal file
23
resources/js/modules/ui/UIManager.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// modules/ui/UIManager.js
|
||||
import { Modal } from './components/Modal.js';
|
||||
|
||||
const components = {
|
||||
modal: Modal,
|
||||
};
|
||||
|
||||
export const UIManager = {
|
||||
open(type, props = {}) {
|
||||
const Component = components[type];
|
||||
if (!Component) {
|
||||
console.warn(`[UIManager] Unknown type: ${type}`);
|
||||
return null;
|
||||
}
|
||||
const instance = new Component(props);
|
||||
instance.open();
|
||||
return instance;
|
||||
},
|
||||
|
||||
close(instance) {
|
||||
if (instance?.close) instance.close();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user