@php
    $registro = $registro ?? null;
    $iconeAtual = $registro->icone ?? null;
    $iconeUrl = $iconeAtual ? \App\Http\Services\Observatorio\ObservatorioUploadHelper::publicUrl($iconeAtual) : null;
@endphp

@include('admin.observatorio.partials._assets')

<div class="col-md-8">
    <label class="form-label" for="icone_arquivo">{{ __('Upload de Ícone do Tema') }}</label>
    <input type="file"
           name="icone_arquivo"
           id="icone_arquivo"
           class="form-control @error('icone_arquivo') is-invalid @enderror"
           accept="image/jpeg,image/png,image/gif,image/webp,image/bmp,image/svg+xml">
    @error('icone_arquivo')<div class="invalid-feedback">{{ $message }}</div>@enderror
    <small class="text-muted d-block mt-1">
        {{ __('Formatos aceitos: JPG, PNG, GIF, WEBP, BMP ou SVG. Tamanho máximo: 2 MB.') }}
    </small>

    @if($iconeUrl)
        <div class="mt-3">
            <span class="text-muted d-block mb-1">{{ __('Ícone atual:') }}</span>
            <img src="{{ $iconeUrl }}" alt="{{ __('Ícone do tema') }}" class="img-thumbnail observatorio-icon-preview-md">
        </div>
    @endif
</div>
