diff --git a/composeApp/src/commonMain/kotlin/ru/slartus/boostbuddy/ui/screens/post/PostScreen.kt b/composeApp/src/commonMain/kotlin/ru/slartus/boostbuddy/ui/screens/post/PostScreen.kt index 2f6a66d..9ca005b 100644 --- a/composeApp/src/commonMain/kotlin/ru/slartus/boostbuddy/ui/screens/post/PostScreen.kt +++ b/composeApp/src/commonMain/kotlin/ru/slartus/boostbuddy/ui/screens/post/PostScreen.kt @@ -53,7 +53,7 @@ internal fun PostScreen(component: PostComponent) { Scaffold( topBar = { TopAppBar( - title = { }, + title = { Text("Комментарии") }, navigationIcon = { IconButton(onClick = { component.onBackClicked() @@ -83,21 +83,37 @@ internal fun PostScreen(component: PostComponent) { PostViewState.ProgressState.Loading -> LoaderView() is PostViewState.ProgressState.Loaded -> - CommentsView( - comments = state.comments, - hasMore = state.hasMoreComments, - onMoreClick = { - component.onMoreCommentsClicked() - }, - onMoreRepliesClick = { - component.onMoreRepliesClicked(it) - } - ) + if (state.comments.isEmpty()) + EmptyCommentsView() + else + CommentsView( + comments = state.comments, + hasMore = state.hasMoreComments, + onMoreClick = { + component.onMoreCommentsClicked() + }, + onMoreRepliesClick = { + component.onMoreRepliesClicked(it) + } + ) } } } } +@Composable +private fun EmptyCommentsView() { + Box( + modifier = Modifier.fillMaxSize(), + contentAlignment = Alignment.Center + ) { + Text( + text = "Список комментариев пуст", + style = MaterialTheme.typography.bodyMedium + ) + } +} + @Composable private fun CommentsView( comments: ImmutableList,