diff --git a/app/src/main/java/eu/steffo/twom/composables/errorhandling/LocalizableError.kt b/app/src/main/java/eu/steffo/twom/composables/errorhandling/LocalizableError.kt index 6cba1bc..3fbfca0 100644 --- a/app/src/main/java/eu/steffo/twom/composables/errorhandling/LocalizableError.kt +++ b/app/src/main/java/eu/steffo/twom/composables/errorhandling/LocalizableError.kt @@ -4,6 +4,7 @@ import android.util.Log import androidx.annotation.StringRes import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState +import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import kotlinx.coroutines.CancellationException @@ -31,6 +32,16 @@ fun LocalizableError?.Display(contents: @Composable (rendered: String) -> Unit) contents(rendered) } +@Composable +fun LocalizableError?.DisplayErrorText(modifier: Modifier = Modifier) { + this.Display { + ErrorText( + modifier = modifier, + text = it, + ) + } +} + suspend fun MutableState.capture( @StringRes error: Int, coroutine: suspend () -> Unit,