<?php
declare(strict_types=1);

namespace ROITheme\Admin\ThemeSettings\Infrastructure\FieldMapping;

use ROITheme\Admin\Shared\Domain\Contracts\FieldMapperInterface;

/**
 * Field Mapper para Theme Settings
 *
 * RESPONSABILIDAD:
 * - Mapear field IDs del formulario a atributos de BD
 * - Solo conoce sus propios campos (modularidad)
 *
 * NOTA: Logo/branding se gestiona desde el componente navbar
 */
final class ThemeSettingsFieldMapper implements FieldMapperInterface
{
    public function getComponentName(): string
    {
        return 'theme-settings';
    }

    public function getFieldMapping(): array
    {
        return [
            // Layout
            'themeSettingsContainerMaxWidth' => ['group' => 'layout', 'attribute' => 'container_max_width'],
            'themeSettingsContentColumnWidth' => ['group' => 'layout', 'attribute' => 'content_column_width'],

            // Custom Code
            'themeSettingsCustomCss' => ['group' => 'custom_code', 'attribute' => 'custom_css'],
            'themeSettingsCustomJsHeader' => ['group' => 'custom_code', 'attribute' => 'custom_js_header'],
            'themeSettingsCustomJsFooter' => ['group' => 'custom_code', 'attribute' => 'custom_js_footer'],
        ];
    }
}
