chore: implementiere MsFilePicker-Komponente, ersetze veraltete Input-Felder in Geräteneukonfiguration und ZNS-Importer, verbessere Vereinskarten-Darstellung und Detail-UX, behebe Tippfehler in settings.json

This commit is contained in:
2026-04-20 02:00:31 +02:00
parent 9fe889b2c1
commit d4aeba4666
11 changed files with 337 additions and 248 deletions
@@ -102,6 +102,27 @@ fun VereinScreen(
)
}
@Composable
fun VereinCard(
verein: Verein,
onEdit: (() -> Unit)? = null,
onOpenInMaps: () -> Unit = {}
) {
VereinCardPreview(
name = verein.name,
langname = verein.langname,
ort = verein.ort,
plz = verein.plz,
strasse = verein.strasse,
hausnummer = verein.hausnummer,
bundesland = verein.bundesland,
logoUrl = verein.logoUrl,
logoBase64 = verein.logoBase64,
status = verein.status,
onEdit = onEdit
)
}
@Composable
private fun VereinCardPreview(
name: String,
@@ -113,7 +134,8 @@ private fun VereinCardPreview(
bundesland: String?,
logoUrl: String?,
logoBase64: String?,
status: VereinStatus
status: VereinStatus,
onEdit: (() -> Unit)? = null
) {
val uriHandler = LocalUriHandler.current
@@ -209,6 +231,15 @@ private fun VereinCardPreview(
size = ButtonSize.SMALL
)
}
if (onEdit != null) {
MsButton(
text = "Bearbeiten",
onClick = onEdit,
variant = ButtonVariant.OUTLINE,
size = ButtonSize.SMALL
)
}
}
}
}
@@ -243,14 +274,45 @@ private fun VereinListContent(
items = uiState.searchResults,
columns = listOf(
MsColumnDefinition(
title = "Name",
weight = 1.5f,
cellRenderer = { Text(it.name, style = MaterialTheme.typography.bodySmall) }
),
MsColumnDefinition(
title = "Ort",
weight = 1f,
cellRenderer = { Text(it.ort ?: "-", style = MaterialTheme.typography.bodySmall) }
title = "Verein",
weight = 2f,
cellRenderer = {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(12.dp),
modifier = Modifier.padding(vertical = 4.dp)
) {
Box(
modifier = Modifier
.size(32.dp)
.clip(CircleShape)
.background(MaterialTheme.colorScheme.primary.copy(alpha = 0.1f)),
contentAlignment = Alignment.Center
) {
if (!it.logoBase64.isNullOrBlank()) {
val bitmap = remember(it.logoBase64) { decodeBase64ToImage(it.logoBase64) }
if (bitmap != null) {
androidx.compose.foundation.Image(
bitmap = bitmap,
contentDescription = null,
modifier = Modifier.fillMaxSize().clip(CircleShape),
contentScale = androidx.compose.ui.layout.ContentScale.Crop
)
} else {
Icon(Icons.Default.Business, null, modifier = Modifier.size(16.dp))
}
} else {
Icon(Icons.Default.Business, null, modifier = Modifier.size(16.dp))
}
}
Column {
Text(it.name, style = MaterialTheme.typography.bodySmall, fontWeight = FontWeight.Bold)
if (!it.ort.isNullOrBlank()) {
Text(it.ort, style = MaterialTheme.typography.labelSmall, color = Color.Gray)
}
}
}
}
),
MsColumnDefinition(
title = "OePS-Nr",