@@ -93,17 +93,25 @@ fun DashboardScreen(navController: NavController) {
9393 fontWeight = FontWeight .SemiBold
9494 )
9595 Spacer (modifier = Modifier .height(12 .dp))
96- ChannelGroupsRow (
97- channelGroups = uiState.feedGroups,
98- onAllGroupsClick = { },
99- onChannelGroupClick = { group ->
100- val route = Screen .Feed .createRoute(
101- id = group.uid,
102- name = group.name
103- )
104- navController.navigate(route)
105- }
106- )
96+ if (uiState.feedGroups.isEmpty()) {
97+ Text (
98+ text = stringResource(MR .strings.empty_pinned_feed_groups),
99+ style = MaterialTheme .typography.bodyMedium,
100+ color = MaterialTheme .colorScheme.onSurfaceVariant
101+ )
102+ } else {
103+ ChannelGroupsRow (
104+ channelGroups = uiState.feedGroups,
105+ onAllGroupsClick = { },
106+ onChannelGroupClick = { group ->
107+ val route = Screen .Feed .createRoute(
108+ id = group.uid,
109+ name = group.name
110+ )
111+ navController.navigate(route)
112+ }
113+ )
114+ }
107115 }
108116
109117
@@ -120,18 +128,26 @@ fun DashboardScreen(navController: NavController) {
120128 fontWeight = FontWeight .SemiBold
121129 )
122130 Spacer (modifier = Modifier .height(16 .dp))
123- LazyRow (
124- horizontalArrangement = Arrangement .spacedBy(16 .dp),
125- contentPadding = PaddingValues (horizontal = 4 .dp)
126- ) {
127- items(
128- items = uiState.playlists,
129- key = { it.url }
130- ) { playlist ->
131- PlaylistCard (
132- playlist = playlist,
133- onClick = { navController.navigate(Screen .PlaylistDetail .createRoute(playlist.url, playlist.serviceId)) }
134- )
131+ if (uiState.playlists.isEmpty()) {
132+ Text (
133+ text = stringResource(MR .strings.empty_pinned_playlists),
134+ style = MaterialTheme .typography.bodyMedium,
135+ color = MaterialTheme .colorScheme.onSurfaceVariant
136+ )
137+ } else {
138+ LazyRow (
139+ horizontalArrangement = Arrangement .spacedBy(16 .dp),
140+ contentPadding = PaddingValues (horizontal = 4 .dp)
141+ ) {
142+ items(
143+ items = uiState.playlists,
144+ key = { it.url }
145+ ) { playlist ->
146+ PlaylistCard (
147+ playlist = playlist,
148+ onClick = { navController.navigate(Screen .PlaylistDetail .createRoute(playlist.url, playlist.serviceId)) }
149+ )
150+ }
135151 }
136152 }
137153 }
@@ -162,15 +178,23 @@ fun DashboardScreen(navController: NavController) {
162178 )
163179 }
164180 Spacer (modifier = Modifier .height(16 .dp))
165- LazyRow (
166- horizontalArrangement = Arrangement .spacedBy(16 .dp),
167- contentPadding = PaddingValues (horizontal = 4 .dp)
168- ) {
169- items(uiState.historyItems) { item ->
170- HistoryCard (
171- item = item,
172- onClick = { SharedContext .sharedVideoDetailViewModel.loadVideoDetails(item.url) }
173- )
181+ if (uiState.historyItems.isEmpty()) {
182+ Text (
183+ text = stringResource(MR .strings.empty_history),
184+ style = MaterialTheme .typography.bodyMedium,
185+ color = MaterialTheme .colorScheme.onSurfaceVariant
186+ )
187+ } else {
188+ LazyRow (
189+ horizontalArrangement = Arrangement .spacedBy(16 .dp),
190+ contentPadding = PaddingValues (horizontal = 4 .dp)
191+ ) {
192+ items(uiState.historyItems) { item ->
193+ HistoryCard (
194+ item = item,
195+ onClick = { SharedContext .sharedVideoDetailViewModel.loadVideoDetails(item.url) }
196+ )
197+ }
174198 }
175199 }
176200 }
0 commit comments