<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('name')->label(__('Name')),
                Field::make('code')->label(__('Code')),
                Field::make('semester_id')->label(__('Semester Id')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
