refactor(frontend): simplify imports and update syntax for wizard steps and delay durations

- Consolidated `material3` imports in `CreateBewerbWizardScreen` and `TurnierBewerbeTab` for cleaner code.
- Switched `WizardStep.values()` to `WizardStep.entries.toTypedArray()` for improved readability.
- Changed `kotlinx.coroutines.delay` argument to use `Duration.milliseconds` for enhanced clarity and type safety.
This commit is contained in:
2026-04-10 10:04:22 +02:00
parent 363aa80fe4
commit fbed4d34cc
4 changed files with 5 additions and 18 deletions
@@ -8,6 +8,7 @@ import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import kotlin.time.Duration.Companion.milliseconds
data class BewerbListItem(
val id: Long,
@@ -129,7 +130,7 @@ class BewerbViewModel(
// In einer echten Implementierung würde hier der StartlistenService (oder ein API-Call)
// aufgerufen werden. Für den MVP/Prototyp simulieren wir die Generierung.
scope.launch {
kotlinx.coroutines.delay(800) // Simulation
kotlinx.coroutines.delay(800.milliseconds) // Simulation
val mockStartliste = listOf(
StartlistenZeile(1, "08:00", "Max Mustermann", "Ares", "VORNE"),
StartlistenZeile(2, "08:05", "Susi Sonnenschein", "Bibi", "KEIN_WUNSCH"),
@@ -3,18 +3,7 @@ package at.mocode.turnier.feature.presentation
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Checkbox
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.SecondaryTabRow
import androidx.compose.material3.Tab
import androidx.compose.material3.TabRowDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -64,7 +53,7 @@ fun CreateBewerbWizardScreen(
onSubmit: (CreateBewerbPayload) -> Unit,
) {
var selectedTab by remember { mutableStateOf(0) }
val steps = WizardStep.values()
val steps = WizardStep.entries.toTypedArray()
Column(modifier.fillMaxSize().padding(16.dp)) {
Text("Neuen Bewerb anlegen", style = MaterialTheme.typography.titleLarge, fontWeight = FontWeight.Bold)
@@ -15,13 +15,11 @@ import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Dialog
import java.io.File
import javax.swing.JFileChooser
import javax.swing.filechooser.FileNameExtensionFilter