// 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();
    }
};
