diff --git a/app/src/main/java/eu/steffo/twom/composables/errorhandling/ErrorText.kt b/app/src/main/java/eu/steffo/twom/composables/errorhandling/ErrorText.kt index 452134b..9cc9a5c 100644 --- a/app/src/main/java/eu/steffo/twom/composables/errorhandling/ErrorText.kt +++ b/app/src/main/java/eu/steffo/twom/composables/errorhandling/ErrorText.kt @@ -4,16 +4,20 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import eu.steffo.twom.R @Composable +@Preview fun ErrorText( - text: String, modifier: Modifier = Modifier, + text: String? = null, ) { Text( modifier = modifier, - text = text, + text = text ?: stringResource(R.string.error), color = MaterialTheme.colorScheme.error, ) }