package com.nate.posedetection

import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import com.performancecoachlab.posedetection.custom.ModelPath

@Composable
actual fun discoverModels(): List<NamedModel> {
    val context = LocalContext.current
    val assets = context.assets.list("") ?: emptyArray()
    return assets
        .filter { it.endsWith(".tflite") }
        .sorted()
        .map { filename ->
            val displayName = filename.removeSuffix(".tflite")
                .replace('_', ' ')
            NamedModel(
                name = displayName,
                path = ModelPath(androidModelPath = filename)
            )
        }
}

