package eu.friedcutlet.yokan.ui.components import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.material3.AlertDialog import androidx.compose.material3.MaterialTheme import androidx.compose.material3.RadioButton import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource import yokan.composeapp.generated.resources.Res import yokan.composeapp.generated.resources.action_cancel /** * Modal single-choice picker. Replaces the "tap to cycle" pattern from the early settings tiles * (where each click rotated through values) with a dialog that shows every option with a * RadioButton, matching how Aniyomi / Mihon expose enum settings. */ @Composable fun ChoiceDialog( title: String, options: List, selected: T?, label: (T) -> String, onSelect: (T) -> Unit, onDismiss: () -> Unit, ) { AlertDialog( onDismissRequest = onDismiss, modifier = Modifier.compactDialogWidth(), // MUI's `