<?php

namespace App\Filament\Loggers;

use App\Models\Home;
use App\Filament\Resources\HomeResource;
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 HomeLogger extends Logger
{
    public static ?string $model = Home::class;

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('main_title')->label(__('Main Title')),
                Field::make('main_description')->label(__('Main Description')),
                Field::make('top_image')->label(__('Top Image')),
                Field::make('count_items')->label(__('Count Items')),
                Field::make('gallery_count')->label(__('Gallery Count')),
                Field::make('news_count')->label(__('News Count')),
                Field::make('program_count')->label(__('Program Count')),
                Field::make('bottom_image')->label(__('Bottom Image')),
                Field::make('bottom_text')->label(__('Bottom Text')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
