import "../apps/Forum.js"
import "../apps/Messages.js"
import "../apps/Market.js"

class AppWindow extends Shadow {
    app;

    render() {
        ZStack(() => {
            console.log("happening")
            switch(this.app) {
                case "Forum":
                    Forum()
                    break;
                case "Messages":
                    Messages()
                    break;
                case "Market":
                    Market()
                    break;
            }
        })
        .display(this.app ? '' : 'none')
        .width(100, "vw")
        .height(100, "vh")
        .backgroundColor("var(--main)")
        .position("fixed")
        .top(0)
        .left(0)
    }

    open(app) {
        this.app = app
        this.rerender()
    }

    close() {
        this.style.display = "none"
    }

}

registerShadow(AppWindow, "app-window")