<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('firstName')->label(__('First Name')),
                Field::make('lastName')->label(__('Last Name')),
                Field::make('country')->label(__('Country')),
                Field::make('region')->label(__('Region')),
                Field::make('phone_number')->label(__('Phone Number')),
                Field::make('email')->label(__('Email')),
                Field::make('message')->label(__('Message')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
