61 lines
1.9 KiB
Kotlin
61 lines
1.9 KiB
Kotlin
package com.example.snapandsolve.view
|
|
|
|
import DamageWithDistance
|
|
import androidx.compose.foundation.layout.Spacer
|
|
import androidx.compose.foundation.layout.height
|
|
import androidx.compose.material3.MaterialTheme
|
|
import androidx.compose.material3.Text
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.unit.dp
|
|
import com.example.snapandsolve.ui.theme.composable.AppButton
|
|
import com.example.snapandsolve.ui.theme.composable.AppButtonStyle
|
|
import com.example.snapandsolve.ui.theme.composable.DamageListItem
|
|
import com.example.snapandsolve.ui.theme.composable.DialogContainer
|
|
import com.example.snapandsolve.ui.theme.composable.EqualWidthButtonRow
|
|
|
|
@Composable
|
|
fun CloseDamageDialog(
|
|
hits: List<DamageWithDistance>,
|
|
onDismiss: () -> Unit,
|
|
onProceedAnyway: () -> Unit,
|
|
) {
|
|
DialogContainer(
|
|
title = "Ähnliche Schäden in der Nähe",
|
|
onDismiss = onDismiss,
|
|
footer = {
|
|
EqualWidthButtonRow {
|
|
AppButton(
|
|
text = { "Abbrechen" },
|
|
style = AppButtonStyle.Outlined,
|
|
onClick = onDismiss,
|
|
modifier = Modifier.weight(1f)
|
|
)
|
|
AppButton(
|
|
text = { "Trotzdem hinzufügen" },
|
|
style = AppButtonStyle.Filled,
|
|
onClick = onProceedAnyway,
|
|
modifier = Modifier.weight(1f)
|
|
)
|
|
}
|
|
}
|
|
) {
|
|
Text(
|
|
text = "Es wurden ${hits.size} ähnliche Meldung(en) in deiner Nähe.",
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
|
)
|
|
|
|
Spacer(Modifier.height(12.dp))
|
|
|
|
// Liste
|
|
hits.forEach { hit ->
|
|
DamageListItem(
|
|
damage = hit,
|
|
onClick = {}
|
|
)
|
|
Spacer(Modifier.height(10.dp))
|
|
}
|
|
}
|
|
}
|