package com.fabledsword.minstrel.nav

import androidx.compose.animation.AnimatedContentScope
import androidx.compose.animation.ExperimentalSharedTransitionApi
import androidx.compose.animation.SharedTransitionScope
import androidx.compose.runtime.staticCompositionLocalOf

/**
 * Scope hand-off for shared-element (Hero) transitions between
 * MiniPlayer and NowPlaying covers.
 *
 * [LocalSharedTransitionScope] is provided once by the
 * `SharedTransitionLayout` wrapping the NavHost.
 * [LocalAnimatedContentScope] is re-provided per `composable<X>`
 * destination since each route has its own AnimatedContentScope.
 *
 * Both are nullable so widgets degrade gracefully (no hero, but
 * still render) outside a SharedTransitionLayout — useful in
 * previews and tests.
 */
@OptIn(ExperimentalSharedTransitionApi::class)
val LocalSharedTransitionScope = staticCompositionLocalOf<SharedTransitionScope?> { null }

val LocalAnimatedContentScope = staticCompositionLocalOf<AnimatedContentScope?> { null }

/** Shared-element key for the MiniPlayer → NowPlaying cover hero. */
const val HERO_KEY_NOW_PLAYING_COVER = "now-playing-cover"
