/*!
 *
 * Copyright (c) 2020-2025 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    TreatmentAdjustmentUltrafiltrationMetrics.qml
 * \author  (last)      Stephen Quong
 * \date    (last)      19-Aug-2025
 * \author  (original)  Stephen Quong
 * \date    (original)  19-Aug-2025
 *
 */

// Qt
import QtQuick 2.12

// Project

//  Qml imports
import "qrc:/globals"

/*!
 * \brief   TreatmentAdjustmentUltrafiltrationMetrics contains components
 *          that display the ultrafiltration volume removed and goal.
 */
Item { id: _root
    property alias  leftLabel   : _left.label
    property alias  leftUnit    : _left.unit
    property alias  leftValue   : _left.value
    property alias  leftColor   : _left.valueColor
    property alias  rightLabel  : _right.label
    property alias  rightUnit   : _right.unit
    property alias  rightValue  : _right.value
    property alias  rightColor  : _right.valueColor

    implicitWidth   : (_left.width * 2) + Variables.columnSpacing
    implicitHeight  : _left.height

    LabelUnitText { id: _left
        objectName  : "_left"
        anchors {
            horizontalCenter        : parent.horizontalCenter
            horizontalCenterOffset  : -(width + Variables.columnSpacing)/2
            verticalCenter          : parent.verticalCenter
        }
        width       : 420
        label       : ""
        unit        : ""
        value       : ""
    }

    LabelUnitText { id: _right
        objectName  : "_right"
        anchors {
            horizontalCenter        : parent.horizontalCenter
            horizontalCenterOffset  : (width + Variables.columnSpacing)/2
            verticalCenter          : parent.verticalCenter
        }
        width       : _left.width
        label       : qsTr("UF Volume Goal")
        unit        : Variables.unitVolume
        value       : _root.rightValue.toFixed(Variables.ultrafiltrationPrecision)
        valueColor  : Colors.fluidText
    }
}
