package com.lazy.emulate.ui.adaptive

import androidx.compose.material3.windowsizeclass.WindowSizeClass
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass

enum class LayoutType {
    COMPACT,   // Phone portrait
    MEDIUM,    // Foldable inner / small tablet
    EXPANDED   // Tablet landscape
}

fun WindowSizeClass.toLayoutType(): LayoutType {
    return when (widthSizeClass) {
        WindowWidthSizeClass.Compact -> LayoutType.COMPACT
        WindowWidthSizeClass.Medium -> LayoutType.MEDIUM
        WindowWidthSizeClass.Expanded -> LayoutType.EXPANDED
        else -> LayoutType.COMPACT
    }
}

fun LayoutType.gridColumns(): Int = when (this) {
    LayoutType.COMPACT -> 2
    LayoutType.MEDIUM -> 3
    LayoutType.EXPANDED -> 4
}
