<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('title')->label(__('Title')),
                Field::make('text')->label(__('Text')),
                Field::make('images')->label(__('Images')),
                Field::make('display_count')->label(__('Display Count')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
