<?php

namespace PHPNative\Tailwind\Style;

enum MediaQueryEnum: int
{
    case normal = 0;
    case ms = 640;
    case dm = 768;
    case gl = 1024;
    case lx = 1280;
    case lx2 = 1536;

    public static function getFromPixel(int $windowWidth)
    {
        if($windowWidth > self::lx2->value) {
            return self::lx2;
        }
        if($windowWidth > self::lx->value) {
            return self::lx;
        }
        if($windowWidth > self::gl->value) {
            return self::gl;
        }
        if($windowWidth > self::dm->value) {
            return self::dm;
        }
        if($windowWidth > self::ms->value) {
            return self::ms;
        }
        return self::normal;
    }
}