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
|
|
|
|
2023-09-25 12:39:54 +00:00
|
|
|
ColumnLayout {
|
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 {
|
2023-09-25 12:39:54 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredHeight: 20
|
|
|
|
Layout.preferredWidth: 20
|
2022-07-27 21:10:00 +00:00
|
|
|
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
|
2023-09-25 12:39:54 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.preferredHeight: 18
|
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
|
|
|
|
color: Style.current.danger
|
2023-01-27 13:16:42 +00:00
|
|
|
visible: !isLoading
|
|
|
|
}
|
|
|
|
Loader {
|
|
|
|
id: loadingComponent
|
2023-09-25 12:39:54 +00:00
|
|
|
Layout.preferredHeight: 32
|
|
|
|
Layout.preferredWidth: root.width - Style.current.xlPadding
|
2023-01-27 13:16:42 +00:00
|
|
|
active: isLoading && d.isValid
|
|
|
|
sourceComponent: LoadingComponent { radius: 4 }
|
2020-09-01 03:49:05 +00:00
|
|
|
}
|
|
|
|
}
|