<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('main_title')->label(__('Main Title')),
                Field::make('background_image')->label(__('Background Image')),
                Field::make('text')->label(__('Text')),
                Field::make('images')->label(__('Images')),
                Field::make('event_count')->label(__('Event Count')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
