
// Qt
import QtQuick 2.12
import QtGraphicalEffects 1.12

// Project
//  Qml imports
import "qrc:/globals"
import "qrc:/components"
import "qrc:/pages/rxmanager"
import "qrc:/pages/pretreatment/create"


Item { id: _root
    signal addProfile()
    signal loadProfile()
    property bool onShow: true
    property bool showCreateRx: false

    RxManagerHeader{id: _rxHeader
        anchors {
            top         : parent.top
            left        : parent.left
            right       : parent.right
            topMargin   :   Variables.defaultMargin * 2
            leftMargin  :   Variables.defaultMargin * 3
            rightMargin :   Variables.defaultMargin * 3
        }

        height: 100
        onShow: _root.onShow
        visible: ! showCreateRx
        onAddClicked:{
            _root.addProfile()
        }
    }
    RxManagerList{
        id: _rxManagerListView
        anchors {
            left        : parent.left
            right       : parent.right
            bottom      : parent.bottom
            top         : _rxHeader.bottom
            leftMargin  : Variables.defaultMargin * 3
            rightMargin : Variables.defaultMargin * 3
            bottomMargin: _root.onShow ? Variables.notificationHeight + Variables.alarmDialogHeaderHeight : Variables.notificationHeight
        }
        model: vRxProfiles.rxProfiles 
        onShow: _root.onShow
        onLoadRxProfile:{
            _root.loadProfile()
        }
    }
}
