Skip to content

Commit

Permalink
Update error view with message and retry icon
Browse files Browse the repository at this point in the history
  • Loading branch information
zwarm committed Jun 13, 2024
1 parent 6b3988c commit d94a609
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
}
}

Expand Down

0 comments on commit d94a609

Please sign in to comment.