package p.studio.workspaces.assets.details.bank;

import p.studio.controls.banks.StudioAssetCapacitySeverity;

import java.util.Objects;

public record AssetDetailsBankCompositionCapacityState(
        double progress,
        StudioAssetCapacitySeverity severity,
        boolean blocked,
        String labelText,
        String hintText) {

    public AssetDetailsBankCompositionCapacityState {
        progress = Math.max(0.0d, Math.min(1.0d, progress));
        severity = severity == null ? StudioAssetCapacitySeverity.GREEN : severity;
        labelText = Objects.requireNonNullElse(labelText, "");
        hintText = Objects.requireNonNullElse(hintText, "");
    }
}
