package dev.ulfrx.recipe.navigation

import androidx.navigation3.runtime.NavKey
import kotlinx.serialization.Serializable

/**
 * Each leaf is `@Serializable` because Nav 3 persists the back stack via
 * kotlinx-serialization (process-death restore). Recipes have no tab — they
 * land in [RecipeDetail] via the shell-wide search overlay.
 */
sealed interface Screen : NavKey {
    sealed interface Home : Screen {
        @Serializable
        data object Root : Home
    }

    sealed interface Planner : Screen {
        @Serializable
        data object Home : Planner
    }

    sealed interface Pantry : Screen {
        @Serializable
        data object Home : Pantry
    }

    sealed interface Shopping : Screen {
        @Serializable
        data object Home : Shopping
    }

    @Serializable
    data class RecipeDetail(val recipeId: String) : Screen

    sealed interface MealPlanEditor : Screen {
        @Serializable
        data class Open(val source: MealPlanEditorSource) : MealPlanEditor
    }
}
