<?php

namespace App\Filament\Loggers;

use App\Models\NewsEvent;
use App\Filament\Resources\NewsEventResource;
use Illuminate\Contracts\Support\Htmlable;
use Noxo\FilamentActivityLog\Loggers\Logger;
use Noxo\FilamentActivityLog\ResourceLogger\Field;
use Noxo\FilamentActivityLog\ResourceLogger\RelationManager;
use Noxo\FilamentActivityLog\ResourceLogger\ResourceLogger;

class NewsEventLogger extends Logger
{
    public static ?string $model = NewsEvent::class;

    public static function getLabel(): string | Htmlable | null
    {
        return NewsEventResource::getModelLabel();
    }

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('main_title')->label(__('Main Title')),
                Field::make('text')->label(__('Text')),
                Field::make('button_text')->label(__('Button Text')),
                Field::make('button_color')->label(__('Button Color')),
                Field::make('button_background_color')->label(__('Button Background Color')),
                Field::make('news_count')->label(__('News Count')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
