From d94a6091f51dd3773724ff647af9f774b9a38ec4 Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Thu, 13 Jun 2024 11:06:39 -0400 Subject: [PATCH] Update error view with message and retry icon --- .../android/ui/voicetocontent/VoiceToContentScreen.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentScreen.kt b/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentScreen.kt index e2f3fe49a760..3ae4dd42e18c 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentScreen.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentScreen.kt @@ -24,6 +24,7 @@ import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Close +import androidx.compose.material.icons.filled.Refresh import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState @@ -117,7 +118,12 @@ fun ErrorView(model: VoiceToContentUiState) { ) { Header(model.header) Spacer(modifier = Modifier.height(16.dp)) - Text("Unable to use Voice to Content at the moment, please try again later") + Text(stringResource(id = model.errorPanel?.errorMessage?:R.string.voice_to_content_generic_error)) + if (model.errorPanel?.allowRetry == true) { + IconButton(onClick = model.errorPanel.onRetryTap?:{}) { + Icon(imageVector = Icons.Default.Refresh, contentDescription = null) + } + } } }