feat: catalog add loading spinner

This commit is contained in:
Benjamin Nussbaum 2025-11-14 18:39:12 +01:00
parent 2045ce9966
commit 4a32132ea9
3 changed files with 44 additions and 24 deletions

View file

@ -1,6 +1,7 @@
<?php
use App\Services\PluginImportService;
use Livewire\Attributes\Lazy;
use Livewire\Volt\Component;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Cache;
@ -8,7 +9,9 @@ use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Symfony\Component\Yaml\Yaml;
new class extends Component {
new
#[Lazy]
class extends Component {
public array $catalogPlugins = [];
public string $installingPlugin = '';
@ -17,6 +20,20 @@ new class extends Component {
$this->loadCatalogPlugins();
}
public function placeholder()
{
return <<<'HTML'
<div class="space-y-4">
<div class="flex items-center justify-center py-12">
<div class="flex items-center space-x-2">
<flux:icon.loading />
<flux:text>Loading recipes...</flux:text>
</div>
</div>
</div>
HTML;
}
private function loadCatalogPlugins(): void
{
$catalogUrl = config('app.catalog_url');