2020-09-01 03:49:05 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-27 21:10:00 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-10-17 10:17:25 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-07-27 21:10:00 +00:00
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2022-10-17 10:17:25 +00:00
|
|
|
|
2023-09-05 15:27:30 +00:00
|
|
|
import shared.panels 1.0
|
2020-09-01 03:49:05 +00:00
|
|
|
|
2020-10-22 12:06:35 +00:00
|
|
|
Column {
|
2020-09-01 03:49:05 +00:00
|
|
|
id: root
|
2022-07-27 21:10:00 +00:00
|
|
|
|
2022-12-19 13:02:56 +00:00
|
|
|
property int errorType: Constants.NoError
|
2022-10-17 10:17:25 +00:00
|
|
|
property bool isLoading: false
|
2022-05-19 08:53:57 +00:00
|
|
|
|
2022-12-19 13:02:56 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
readonly property bool isValid: root.errorType === Constants.NoError
|
|
|
|
}
|
|
|
|
|
|
|
|
visible: !d.isValid || isLoading
|
|
|
|
spacing: 5
|
|
|
|
|
2022-07-27 21:10:00 +00:00
|
|
|
StatusIcon {
|
2020-09-01 03:49:05 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-07-27 21:10:00 +00:00
|
|
|
height: 20
|
|
|
|
width: 20
|
|
|
|
icon: "cancel"
|
|
|
|
color: Theme.palette.dangerColor1
|
2022-12-19 13:02:56 +00:00
|
|
|
visible: !d.isValid && !isLoading
|
2022-10-17 10:17:25 +00:00
|
|
|
}
|
2020-10-22 12:06:35 +00:00
|
|
|
StyledText {
|
|
|
|
id: txtValidationError
|
2022-07-26 18:14:55 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2023-01-27 13:16:42 +00:00
|
|
|
text: errorType === Constants.SendAmountExceedsBalance ?
|
|
|
|
qsTr("Balance exceeded") : qsTr("No route found")
|
2020-10-22 12:06:35 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: 13
|
|
|
|
height: 18
|
|
|
|
color: Style.current.danger
|
2023-01-27 13:16:42 +00:00
|
|
|
visible: !isLoading
|
|
|
|
}
|
|
|
|
Loader {
|
|
|
|
id: loadingComponent
|
|
|
|
height: 32
|
|
|
|
width: root.width - Style.current.xlPadding
|
|
|
|
active: isLoading && d.isValid
|
|
|
|
sourceComponent: LoadingComponent { radius: 4 }
|
2020-09-01 03:49:05 +00:00
|
|
|
}
|
|
|
|
}
|