<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('program_id')->label(__('Program Id')),
                Field::make('semester_id')->label(__('Semester Id')),
                Field::make('subject_id')->label(__('Subject Id')),
                Field::make('file')->label(__('File')),
                Field::make('file_name')->label(__('File Name')),
                Field::make('file_download_count')->label(__('File Download Count')),
                Field::make('file_category')->label(__('File Category')),
                Field::make('file_released_date')->label(__('File Released Date')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
