<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('name')->label(__('Name')),
                Field::make('surname')->label(__('Surname')),
                Field::make('grade')->label(__('Grade')),
                Field::make('section')->label(__('Section')),
                Field::make('phone_number')->label(__('Phone Number')),
                Field::make('email')->label(__('Email')),
                Field::make('message')->label(__('Message')),
                Field::make('game_id')->label(__('Game')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
