update error content

This commit is contained in:
2026-08-19 19:37:13 +03:00
parent 1d609f88d2
commit a14a659876
11 changed files with 71 additions and 50 deletions
@@ -2,9 +2,7 @@ package ru.shadowsparky.chat.presentation
import androiddev.feature.chat.chat_client.generated.resources.Res
import androiddev.feature.chat.chat_client.generated.resources.chat_input_placeholder
import androiddev.feature.chat.chat_client.generated.resources.chat_load_error
import androiddev.feature.chat.chat_client.generated.resources.chat_ok
import androiddev.feature.chat.chat_client.generated.resources.chat_retry_button
import androiddev.feature.chat.chat_client.generated.resources.send
import androidx.compose.foundation.focusable
import androidx.compose.foundation.gestures.animateScrollBy
@@ -79,6 +77,7 @@ import ru.shadowsparky.chat.domain.ChatRoles
import ru.shadowsparky.chat.domain.Message
import ru.shadowsparky.chat.domain.TextToken
import ru.shadowsparky.ui.components.AlertContent
import ru.shadowsparky.ui.components.ErrorContent
import ru.shadowsparky.ui.components.IconButton
import ru.shadowsparky.ui.components.LazyColumn
import ru.shadowsparky.ui.components.Loading
@@ -107,16 +106,7 @@ fun ChatContent(component: ChatComponent, paddingValues: PaddingValues, state: C
}
is ChatState.Error -> {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
Text(
text = stringResource(Res.string.chat_load_error),
color = MaterialTheme.colorScheme.error
)
Spacer(modifier = Modifier.height(8.dp))
Button(onClick = { component.loadInitialMessages() }) {
Text(stringResource(Res.string.chat_retry_button))
}
}
ErrorContent(message = state.message) { component.clearSendError() }
}
is ChatState.Data -> {
ChatContent(