<?php

declare(strict_types=1);

namespace App\Framework\Http\Responses;

enum MediaType: string
{
    case VIDEO = 'video';
    case AUDIO = 'audio';
    case UNKNOWN = 'unknown';

    public static function fromMimeType(string $mimeType): self
    {
        return match (true) {
            str_starts_with($mimeType, 'video/') => self::VIDEO,
            str_starts_with($mimeType, 'audio/') => self::AUDIO,
            default => self::UNKNOWN
        };
    }
}
