<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('name')->label(__('Name')),
                Field::make('position')->label(__('Position')),
                Field::make('description')->label(__('Description')),
                Field::make('college')->label(__('College')),
                Field::make('image')->label(__('Image')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
