package de.krisenvorrat.app.ui.settings

import android.net.Uri
import de.krisenvorrat.app.domain.model.AgeGroupEntry
import de.krisenvorrat.app.domain.model.defaultAgeGroups

internal data class SettingsUiState(
    val ageGroups: List<AgeGroupEntry> = defaultAgeGroups(),
    val isLoading: Boolean = true,
    val isSaved: Boolean = false,
    val isExporting: Boolean = false,
    val shareContent: ShareContent? = null,
    val exportError: String? = null,
    val isImporting: Boolean = false,
    val importResult: ImportResult? = null,
    val pendingImportUri: Uri? = null,
    val serverUrl: String = "",
    val isLoggedIn: Boolean = false,
    val loggedInUsername: String = "",
    val loginUsername: String = "",
    val loginPassword: String = "",
    val isLoggingIn: Boolean = false,
    val loginError: String? = null,
    val syncStatus: SyncStatus = SyncStatus.Idle,
    val lastSyncTime: String? = null,
    val openAiApiKey: String = ""
)

internal sealed interface SyncStatus {
    data object Idle : SyncStatus
    data object Running : SyncStatus
    data object Success : SyncStatus
    data class Error(val message: String) : SyncStatus
}

internal sealed interface ImportResult {
    data object Success : ImportResult
    data class Error(val message: String) : ImportResult
}
