@props(['block', 'lazyLoading' => false])

@if($image = $block->media->firstWhere('pivot.properties.field', 'image'))
    <section class="hero-image">
        <figure class="hero-image__background">
            <img
                src="{{ $image->getUrl() }}"
                alt="{{ $component->data['title'] ?? '' }}"
                loading="{{ $lazyLoading ? 'lazy': 'eager' }}"
                fetchpriority="{{ $lazyLoading ? 'low': 'high' }}"
            >
        </figure>
    </section>
@endif
