package com.onthelevel.core.design

import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.platform.LocalView

/**
 * Levels are used hands-free; the screen must not time out mid-measurement
 * (BRIEF.md §Level). Scoped to the composable, so leaving the screen releases it.
 */
@Composable
fun KeepScreenOn() {
    val view = LocalView.current
    DisposableEffect(view) {
        view.keepScreenOn = true
        onDispose { view.keepScreenOn = false }
    }
}
