import Vector2 from "../core/geom/Vector2.js";
import TaskProgressView from "../view/task/TaskProgressView.js";

/**
 *
 * @param {Task|TaskGroup} task
 * @param {Localization} localization
 * @param {Vector2} [size]
 * @returns {TaskProgressView}
 */
export function makeSimpleTaskProgressView({
                                               task,
                                               localization,
                                               size = new Vector2(256, 32)
                                           }) {

    const vProgress = new TaskProgressView({
        task,
        localization
    });

    vProgress.size.copy(size);
    vProgress.css({
        position: 'absolute',
        top: 0,
        left: 0,
        pointerEvents: "none"
    });
    vProgress.el.querySelector('.fill').style.background = 'rgb(255,220,94)';
    vProgress.el.querySelector('.progress-bar').style.height = '8px';

    return vProgress;
}