

/* Copyright (c) {{ year }} {{ author }}. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
*/
import QtQuick 2.15
import "js/Constants.js" as Constants

Item {
    id: alertModal
    property alias msg: alertMsg.text

    Rectangle {
        id: alertModalBg
        opacity: 0.5
        color: "#000000"
        anchors.fill: parent
    }

    Rectangle {
        id: alert
        width: 578
        height: 276
        color: Constants.accentColor
        radius: 20
        border.color: Constants.fgColor
        border.width: 4
        anchors.centerIn: parent

        Text {
            id: alertMsg
            text: qsTr("This is an **alert** message")
            horizontalAlignment: Text.AlignHCenter
            wrapMode: Text.WordWrap
            textFormat: Text.MarkdownText
            width: parent.width * 0.8
            font: Constants.font
            anchors.centerIn: parent
        }

        Rectangle {
            id: dismissBtn
            y: 225
            width: 200
            height: 41
            color: Constants.bgColor
            radius: 20
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 10
            anchors.horizontalCenter: parent.horizontalCenter

            Text {
                id: text1
                x: 88
                text: qsTr("Ok")
                anchors.verticalCenter: parent.verticalCenter
                font.family: Constants.font.family
                font.pixelSize: Constants.font.pixelSize
                font.bold: true
                color: Constants.fgColor
            }

            MouseArea {
                id: dismissBtrMouseArea
                anchors.fill: parent
                onClicked: alertModal.visible = false
            }
        }
    }
}
