<?php

namespace App\Modules\UserCompany\Types;

use App\Modules\AppHelpers\Enums\HasEnumHelpers;

enum CompanyType: string
{
    use HasEnumHelpers;

    /** Telekeçi */
    case TELEKECI = 'tel';

    /** Hususy kärhana */
    case HK = 'hk';

    /** Hojalyk jemgyýeti */
    case HJ = 'hj';

    /**
     * Options
     *
     * @return array<string, string>
     */
    public static function options(): array
    {
        return [
            self::TELEKECI->value => __('Telekeçi'),
            self::HK->value => __('Hususy kärhana'),
            self::HJ->value => __('Hojalyk jemgyýeti'),
        ];
    }

    public static function option(?string $key = ''): string
    {
        return self::options()[$key] ?? '-';
    }

    /**
     * Default option
     */
    public static function default(): string
    {
        return self::TELEKECI->value;
    }

    /**
     * Status classes
     *
     * @return array<string, string>
     */
    public static function statusClasses(): array
    {
        return [
            self::TELEKECI->value => 'success',
            self::HK->value => 'danger',
            self::HJ->value => 'warning',
        ];
    }

    /**
     * Get status
     */
    public static function statusClass(?string $key = ''): string
    {
        return self::statusClasses()[$key] ?? 'danger';
    }
}
