|
| 1 | +package org.cru.godtools.ui.dashboard.lessons |
| 2 | + |
| 3 | +import androidx.compose.foundation.layout.Column |
| 4 | +import androidx.compose.foundation.layout.fillMaxWidth |
| 5 | +import androidx.compose.foundation.layout.padding |
| 6 | +import androidx.compose.foundation.layout.size |
| 7 | +import androidx.compose.material.icons.Icons |
| 8 | +import androidx.compose.material.icons.outlined.ErrorOutline |
| 9 | +import androidx.compose.material3.Button |
| 10 | +import androidx.compose.material3.Icon |
| 11 | +import androidx.compose.material3.MaterialTheme |
| 12 | +import androidx.compose.material3.Surface |
| 13 | +import androidx.compose.material3.Text |
| 14 | +import androidx.compose.runtime.Composable |
| 15 | +import androidx.compose.ui.Alignment |
| 16 | +import androidx.compose.ui.Modifier |
| 17 | +import androidx.compose.ui.res.stringResource |
| 18 | +import androidx.compose.ui.text.style.TextAlign |
| 19 | +import androidx.compose.ui.unit.dp |
| 20 | +import org.cru.godtools.R |
| 21 | + |
| 22 | +@Composable |
| 23 | +internal fun NoPersonalizedLessons(onClick: () -> Unit, modifier: Modifier = Modifier) { |
| 24 | + Surface( |
| 25 | + color = MaterialTheme.colorScheme.surfaceVariant, |
| 26 | + modifier = modifier.fillMaxWidth(), |
| 27 | + ) { |
| 28 | + Column( |
| 29 | + horizontalAlignment = Alignment.CenterHorizontally, |
| 30 | + modifier = Modifier.padding(24.dp), |
| 31 | + ) { |
| 32 | + Icon( |
| 33 | + imageVector = Icons.Outlined.ErrorOutline, |
| 34 | + contentDescription = null, |
| 35 | + modifier = Modifier.size(48.dp), |
| 36 | + ) |
| 37 | + Text( |
| 38 | + text = stringResource(R.string.dashboard_lessons_section_personalized_no_lessons_title), |
| 39 | + style = MaterialTheme.typography.titleMedium, |
| 40 | + textAlign = TextAlign.Center, |
| 41 | + modifier = Modifier.padding(top = 16.dp), |
| 42 | + ) |
| 43 | + Text( |
| 44 | + text = stringResource(R.string.dashboard_lessons_section_personalized_no_lessons_description), |
| 45 | + style = MaterialTheme.typography.bodyMedium, |
| 46 | + textAlign = TextAlign.Center, |
| 47 | + modifier = Modifier.padding(top = 8.dp), |
| 48 | + ) |
| 49 | + Button( |
| 50 | + onClick = onClick, |
| 51 | + modifier = Modifier.padding(top = 16.dp), |
| 52 | + ) { |
| 53 | + Text(stringResource(R.string.dashboard_lessons_section_personalized_no_lessons_button)) |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | +} |
0 commit comments