<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('name')->label(__('Name')),
                Field::make('description')->label(__('Description')),
                Field::make('library_title')->label(__('Library Title')),
                Field::make('online_resources_title')->label(__('Online Resources Title')),
                Field::make('resources_title')->label(__('Resources Title')),
                Field::make('resources_description')->label(__('Resources Description')),
                Field::make('opening_hours_title')->label(__('Opening Hours Title')),
                Field::make('library_opening_time')->label(__('Library Opening Time')),
                Field::make('library_closing_time')->label(__('Library Closing Time')),
                Field::make('library_time_description')->label(__('Library Time Description')),
                Field::make('contact_title')->label(__('Contact Title')),
                Field::make('tittle_circulation')->label(__('Tittle Circulation')),
                Field::make('desk_contact_number1')->label(__('Desk Contact Number1')),
                Field::make('desk_contact_number2')->label(__('Desk Contact Number2')),
                Field::make('desk_email')->label(__('Desk Email')),
                Field::make('desk_title_2')->label(__('Desk Title 2')),
                Field::make('renewal_text_1')->label(__('Renewal Text 1')),
                Field::make('renewal_text_2')->label(__('Renewal Text 2')),
                Field::make('renewal_text_3')->label(__('Renewal Text 3')),
                Field::make('background_image')->label(__('Background Image')),
                Field::make('library_policy_title')->label(__('Library Policy Title')),
                Field::make('library_policy_description')->label(__('Library Policy Description')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
