package dev.ulfrx.recipe.ui.keyboard

import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.ime
import androidx.compose.runtime.Composable

@Composable
internal actual fun rememberKeyboardTransitionState(): KeyboardTransitionState {
    val imeInset = WindowInsets.ime.asPaddingValues().calculateBottomPadding()
    return KeyboardTransitionState(
        currentInset = imeInset,
        targetInset = imeInset,
        animationDurationMillis = AndroidKeyboardAnimationDurationMillis,
    )
}

private const val AndroidKeyboardAnimationDurationMillis = 250
