package com.ponzischeme89.memby.ui

internal const val QuickActionsHoldDurationMillis = 650L

internal enum class QuickActionDirection { UP, DOWN }

internal fun quickActionNextIndex(
    currentIndex: Int,
    actionCount: Int,
    direction: QuickActionDirection,
): Int {
    if (actionCount <= 0) return 0
    val current = currentIndex.coerceIn(0, actionCount - 1)
    return when (direction) {
        QuickActionDirection.UP -> (current - 1).coerceAtLeast(0)
        QuickActionDirection.DOWN -> (current + 1).coerceAtMost(actionCount - 1)
    }
}
