@php
$src = ! empty($data['src']) ? asset('storage/' . $data['src']) : null;
$alt = $data['alt'] ?? '';
$caption = $data['caption'] ?? null;
$link = $data['link'] ?? null;
$padding = $options['padding'] ?? 'md';
$alignment = $options['alignment'] ?? 'center';
$maxWidth = $options['max_width'] ?? '100%';
@endphp
<figure class="page-block-image text-{{ $alignment }} py-{{ $padding }}">
    @if($src)
        @if($link)<a href="{{ $link }}">@endif
        <img src="{{ $src }}" alt="{{ $alt }}" style="max-width: {{ $maxWidth }};" class="img-fluid">
        @if($link)</a>@endif
        @if($caption)<figcaption class="text-muted small mt-2">{{ $caption }}</figcaption>@endif
    @endif
</figure>
