import { djbase, djclass } from "@implab/djx/declare";
import { DjxWidgetBase } from "@implab/djx/tsx/DjxWidgetBase";
import { createElement } from "@implab/djx/tsx";
import ProgressBar from "./ProgressBar";

const ref = <W extends DjxWidgetBase, K extends keyof W>(target: W, name: K) => (v: W[K]) => target.set(name, v);

@djclass
export default class MainWidget extends djbase(DjxWidgetBase) {

    titleNode?: HTMLHeadingElement;

    progressBar?: ProgressBar;

    render() {
        return <div>
            <h2 ref={ref(this, "titleNode")}>Hi!</h2>
            <ProgressBar ref={ref(this, "progressBar")}/>
        </div>;
    }
}
