/*!
 *
 * Copyright (c) 2020-2023 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    ConfirmTreatmentTableEntry.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      25-Mar-2021
 * \author  (original)  Peter Lucia
 * \date    (original)  02-Nov-2020
 *
 */

// Qt
import QtQuick 2.12

// Project

//  Qml imports
import "qrc:/globals"
import "qrc:/components"

/*!
 * \brief ConfirmTreatmentTableEntry - A cell of a confirm treatment
 * parameters table with configurable key name, value name, and dimensions.
 * Provides a single component for a repeater when building the column
 */
Rectangle {
    id: _root
    property var key    : "Key"
    property var value  : "Value"

    height: Variables.createTreatmentSubTableHeight
    width: Variables.createTreatmentSubTableWidth
    color: "transparent"

    Line {
        id: _line
        width: _root.width + Variables.createTreatmentTableMargin
        thickness: 2
        color: Colors.backgroundMenu
        anchors.top: _root.bottom
        anchors.left: _root.left
        anchors.leftMargin: -Variables.createTreatmentTableMargin
    }

    Text {
        id: _key
        objectName: key + index
        color: Colors.textMain
        text: key
        anchors.left: parent.left
        anchors.verticalCenter: _root.verticalCenter
        font.pixelSize: Fonts.fontPixelCreateTreatmentTable
    }

    Text {
        id: _value
        objectName: value + index
        color: Colors.textMain
        text: value
        anchors.left: _line.horizontalCenter
        anchors.verticalCenter: _root.verticalCenter
        anchors.leftMargin: 3*Variables.createTreatmentMargin
        font.pixelSize: Fonts.fontPixelCreateTreatmentTable
    }
}
