<?php

namespace App\Support\Badges\Domains;

use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeMapper;
use App\Support\Badges\BadgeSpec;

final class IgnoredAtBadge implements BadgeMapper
{
    public function spec(mixed $value): BadgeSpec
    {
        $state = BadgeCatalog::normalizeState($value);

        if ($state === null) {
            return new BadgeSpec('No', 'gray', 'heroicon-m-minus-circle');
        }

        return new BadgeSpec('Yes', 'warning', 'heroicon-m-exclamation-triangle');
    }
}
