<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('messages_tittle')->label(__('Messages Title')),
                Field::make('messages_name')->label(__('Messages Name')),
                Field::make('messages_position')->label(__('Messages Position')),
                Field::make('messages_text')->label(__('Messages Text')),
                Field::make('messages_photo')->label(__('Messages Photo')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
