<?php

namespace App\Domain\Website\Enums;

enum MediaCollection: string
{
    case AcademyLogo = 'academy_logo';
    case AcademyCover = 'academy_cover';
    case ActivityPhoto = 'activity_photo';
    case BranchPhoto = 'branch_photo';
    case Gallery = 'gallery';
    case TeamPhoto = 'team_photo';
    case TestimonialAvatar = 'testimonial_avatar';
    case PartnerLogo = 'partner_logo';
    case NewsImage = 'news_image';
    case SectionImage = 'section_image';
    case General = 'general';
    case EventCover = 'event_cover';
    case EventGallery = 'event_gallery';

    public function dimensions(): array
    {
        return match ($this) {
            self::AcademyLogo => ['width' => 400, 'height' => 400],
            self::AcademyCover => ['width' => 1920, 'height' => 600],
            self::ActivityPhoto => ['width' => 800, 'height' => 600],
            self::BranchPhoto => ['width' => 1200, 'height' => 800],
            self::Gallery => ['width' => 1200, 'height' => 800],
            self::TeamPhoto => ['width' => 600, 'height' => 600],
            self::TestimonialAvatar => ['width' => 200, 'height' => 200],
            self::PartnerLogo => ['width' => 300, 'height' => 120],
            self::NewsImage => ['width' => 1200, 'height' => 630],
            self::SectionImage => ['width' => 800, 'height' => 600],
            self::General => ['width' => 1200, 'height' => 800],
            self::EventCover => ['width' => 1920, 'height' => 600],
            self::EventGallery => ['width' => 1200, 'height' => 800],
        };
    }

    public function aspectRatio(): string
    {
        return match ($this) {
            self::AcademyLogo => '1:1',
            self::AcademyCover => '16:5',
            self::ActivityPhoto => '4:3',
            self::BranchPhoto => '3:2',
            self::Gallery => '3:2',
            self::TeamPhoto => '1:1',
            self::TestimonialAvatar => '1:1',
            self::PartnerLogo => '5:2',
            self::NewsImage => '1.91:1',
            self::SectionImage => '4:3',
            self::General => '3:2',
            self::EventCover => '16:5',
            self::EventGallery => '3:2',
        };
    }

    public function maxSizeKb(): int
    {
        return match ($this) {
            self::AcademyLogo => 500,
            self::AcademyCover => 2048,
            self::ActivityPhoto => 1024,
            self::BranchPhoto => 1536,
            self::Gallery => 1536,
            self::TeamPhoto => 500,
            self::TestimonialAvatar => 200,
            self::PartnerLogo => 300,
            self::NewsImage => 1536,
            self::SectionImage => 1024,
            self::General => 2048,
            self::EventCover => 2048,
            self::EventGallery => 1536,
        };
    }

    public function label(): string
    {
        return match ($this) {
            self::AcademyLogo => 'شعار الأكاديمية',
            self::AcademyCover => 'صورة الغلاف',
            self::ActivityPhoto => 'صورة النشاط',
            self::BranchPhoto => 'صورة الفرع',
            self::Gallery => 'معرض الصور',
            self::TeamPhoto => 'صورة المدرب',
            self::TestimonialAvatar => 'صورة العميل',
            self::PartnerLogo => 'شعار الشريك',
            self::NewsImage => 'صورة الخبر',
            self::SectionImage => 'صورة القسم',
            self::General => 'صورة عامة',
            self::EventCover => 'غلاف الحدث',
            self::EventGallery => 'معرض صور الحدث',
        };
    }
}
