// Qt
import QtQuick 2.12


// Project
//  Qml imports
import "qrc:/globals"
import "qrc:/components"
import "qrc:/compounds"
import "qrc:/pages/posttreatment"


PostTreatmentBase { id: _root
    signal itemClicked(int vIndex)

    Row { id: _row
        anchors.fill    : parent
        anchors.margins : Variables.defaultMargin * 8
        width           : parent.width
        height          : parent.height
        spacing         : Variables.defaultMargin

        Item { id: _column
            width   : parent.width / 2
            height  : parent.height

            Text { id: _descriptionText
                anchors {
                    left        : parent.left
                    top         : parent.top
                    topMargin   : Variables.defaultMargin * 5
                }

                text                : qsTr("Disinfect the machine per your clinic's instructions.")
                color               : Colors.offWhite
                font.pixelSize      : Fonts.fontPixelTextRectTitle
                width               : parent.width
                height              : 50
            }

            TouchGrid { id: _grid
                anchors {
                    left            : parent.left
                    top             : _descriptionText.bottom
                    topMargin       : Variables.defaultMargin * 2
                }
                alignCenter         : false
                onItemClicked       : _root.itemClicked(vIndex)
                rowCount            : itemsText.count ?? 0
                colCount            : 1
                itemWidth           : _root.width / 2.5
                itemHeight          : Variables.createRxLabelUnitContainerHeight
                lineThickness       : 0
                arrowWidth          : Variables.iconButtonSize
                arrowHeight         : Variables.iconButtonSize
                arrowRightMargin    : Variables.defaultMargin
                delegateColor       :  Colors.panelBackgroundColor
                delegateBorderWidth : 1
                delegateBorderColor : Colors.panelBorderColor
                itemsHasIndent      : Array(itemsText.length).fill(true) // sets all to true
                itemsText           : [ qsTr("Rinseback")                   ,
                                        qsTr("Heat Disinfect")              ,
                                        qsTr("Citric Acid Heat Disinfect")  ,
                                        qsTr("Substitution Port Disinfect") ]
            }
        }

        Item { id: _imageItem
            width   : parent.width / 2
            height  : parent.height

            Image { id: _image
                anchors.right           : parent.right
                anchors.verticalCenter  : parent.verticalCenter
                source                  : "qrc:/images/iLeahiConsole"
            }
        }
    }
}
