<?php

namespace App\Filament\Loggers;

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

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

    public static function resource(ResourceLogger $logger): ResourceLogger
    {
        return $logger
            ->fields([
                Field::make('logo')->label(__('Logo')),
                Field::make('url')->label(__('Url')),
                Field::make('title')->label(__('Title')),
                Field::make('description')->label(__('Description')),
                Field::make('background_image')->label(__('Background Image')),
                Field::make('button_text')->label(__('Button Text')),
                Field::make('button_link')->label(__('Button Link')),
                Field::make('button_color')->label(__('Button Color')),
                Field::make('button_background_color')->label(__('Button Background Color')),
            ])
            ->relationManagers([
                //
            ]);
    }
}
