diff --git a/resources/views/livewire/catalog/index.blade.php b/resources/views/livewire/catalog/index.blade.php index 201ee7e..83a34fc 100644 --- a/resources/views/livewire/catalog/index.blade.php +++ b/resources/views/livewire/catalog/index.blade.php @@ -14,6 +14,8 @@ new class extends Component { public array $catalogPlugins = []; public string $installingPlugin = ''; + public string $previewingPlugin = ''; + public array $previewData = []; public function mount(): void { @@ -117,6 +119,31 @@ class extends Component { $this->installingPlugin = ''; } } + + public function previewPlugin(string $pluginId): void + { + $plugin = collect($this->catalogPlugins)->firstWhere('id', $pluginId); + + if (!$plugin) { + $this->addError('preview', 'Plugin not found.'); + return; + } + + $this->previewingPlugin = $pluginId; + $this->previewData = $plugin; + + // Store scroll position for restoration later + $this->dispatch('store-scroll-position'); + } + + public function closePreview(): void + { + $this->previewingPlugin = ''; + $this->previewData = []; + + // Restore scroll position when returning to catalog + $this->dispatch('restore-scroll-position'); + } }; ?>
No preview image available
+No preview available
+{{ $previewData['description'] }}
+Installs: {{ data_get($recipe, 'stats.installs') }} · Forks: {{ data_get($recipe, 'stats.forks') }}
+{{ $recipe['author_bio'] }}
+