@if(! empty($projects) && count($projects) > 0)
    <div class="grid grid-cols-{{ $columns ?? 3 }} gap-{{ $padding ?? 3 }} {{ $style ?? '' }}">
        @foreach($projects as $project)
            <div class="grid-item">

                <article class="project card">

                    <div class="card-image">
                        <a class="card-link d-block" href="{{ route('frontend.project.show', $project->slug) }}">
                            @if($image = $project->primaryImage())
                                <img class="image {{ $lazy ? 'lazyload' : '' }}"
                                     src="{!! route('frontend.image.show', ['image' => $image, 'preset' => 'medium', 'q' => ($lazy ? '5' : config('image.quality'))]) !!}"
                                     data-src="{!! route('frontend.image.show', ['image' => $image, 'preset' => 'medium']) !!}"
                                     alt="{{ $image->title ?? $project->name }}"
                                     loading="{{ $lazy ? 'lazy' : 'null' }}"
                                />
                            @else
                                <img
                                    class="image"
                                    src="{{ $project->getPlaceholder(['preset' => 'medium']) }}"
                                    alt="{{ $project->name }}"
                                />
                            @endif
                        </a>
                    </div>

                    <div class="card-body">
                        <h5 class="card-title">
                            <a class="card-link" href="{{ route('frontend.project.show', $project->slug) }}">
                                {{ $project->name }}
                            </a>
                        </h5>

                        @if($showSummary)
                            <p class="card-text">
                                {!! str($project->summary)->limit($characters) !!}
                            </p>
                        @endif
                    </div>

                    @if($showButton)
                        <div class="card-footer">
                            <a class="card-link btn btn-primary" href="{{ route('frontend.project.show', $project->slug) }}">
                                Read More
                            </a>
                        </div>
                    @endif
                </article>

            </div>
        @endforeach
    </div>
@else
    <div class="border rounded text-center p-4 bg-white">
        <p class="text-muted text-uppercase m-0">PROJECTS NOT FOUND...</p>
    </div>
@endif
