fix: lazy load plugin images

This commit is contained in:
Benjamin Nussbaum 2025-11-08 15:45:16 +01:00
parent b2eeb91719
commit 87a73046c5
2 changed files with 2 additions and 2 deletions

View file

@ -119,7 +119,7 @@ new class extends Component {
<div class="bg-white dark:bg-white/10 border border-zinc-200 dark:border-white/10 [:where(&)]:p-6 [:where(&)]:rounded-xl space-y-6"> <div class="bg-white dark:bg-white/10 border border-zinc-200 dark:border-white/10 [:where(&)]:p-6 [:where(&)]:rounded-xl space-y-6">
<div class="flex items-start space-x-4"> <div class="flex items-start space-x-4">
@if($plugin['logo_url']) @if($plugin['logo_url'])
<img src="{{ $plugin['logo_url'] }}" alt="{{ $plugin['name'] }}" class="w-12 h-12 rounded-lg object-cover"> <img src="{{ $plugin['logo_url'] }}" loading="lazy" alt="{{ $plugin['name'] }}" class="w-12 h-12 rounded-lg object-cover">
@else @else
<div class="w-12 h-12 bg-gray-200 dark:bg-gray-700 rounded-lg flex items-center justify-center"> <div class="w-12 h-12 bg-gray-200 dark:bg-gray-700 rounded-lg flex items-center justify-center">
<flux:icon name="puzzle-piece" class="w-6 h-6 text-gray-400" /> <flux:icon name="puzzle-piece" class="w-6 h-6 text-gray-400" />

View file

@ -169,7 +169,7 @@ new class extends Component {
<div class="flex items-start space-x-4"> <div class="flex items-start space-x-4">
@php($thumb = $recipe['icon_url'] ?? $recipe['screenshot_url']) @php($thumb = $recipe['icon_url'] ?? $recipe['screenshot_url'])
@if($thumb) @if($thumb)
<img src="{{ $thumb }}" alt="{{ $recipe['name'] }}" class="w-12 h-12 rounded-lg object-cover"> <img src="{{ $thumb }}" loading="lazy" alt="{{ $recipe['name'] }}" class="w-12 h-12 rounded-lg object-cover">
@else @else
<div class="w-12 h-12 bg-gray-200 dark:bg-gray-700 rounded-lg flex items-center justify-center"> <div class="w-12 h-12 bg-gray-200 dark:bg-gray-700 rounded-lg flex items-center justify-center">
<flux:icon name="puzzle-piece" class="w-6 h-6 text-gray-400" /> <flux:icon name="puzzle-piece" class="w-6 h-6 text-gray-400" />