package com.github.nullptroma.wallenc.ui

import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.viewmodel.compose.SavedStateHandleSaveableApi
import androidx.lifecycle.viewmodel.compose.saveable
import com.github.nullptroma.wallenc.ui.screens.main.MainRoute
import com.github.nullptroma.wallenc.ui.screens.main.screens.tasks.TaskPipelineRoute
import com.github.nullptroma.wallenc.ui.screens.settings.SettingsRoute
import com.github.nullptroma.wallenc.ui.screens.sync.StorageSyncRoute
import dagger.hilt.android.lifecycle.HiltViewModel

@HiltViewModel
class WallencViewModel @javax.inject.Inject constructor(savedStateHandle: SavedStateHandle) :
    ViewModelBase<Unit>(Unit) {
    @OptIn(SavedStateHandleSaveableApi::class)
    var routes by savedStateHandle.saveable {
        mutableStateOf(
            mapOf(
                MainRoute::class.qualifiedName!! to MainRoute(),
                TaskPipelineRoute::class.qualifiedName!! to TaskPipelineRoute(),
                StorageSyncRoute::class.qualifiedName!! to StorageSyncRoute(),
                SettingsRoute::class.qualifiedName!! to SettingsRoute()
            )
        )
    }
        private set
}