2024-10-14 20:25:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\View\Page;
|
|
|
|
|
|
|
|
use App\Setting\SettingFactory;
|
|
|
|
use Illuminate\View\Component;
|
|
|
|
|
|
|
|
class SettingLayout extends Component
|
|
|
|
{
|
|
|
|
|
|
|
|
public array $entries;
|
|
|
|
|
|
|
|
public function __construct(public string $active)
|
|
|
|
{
|
|
|
|
$this->entries = app(SettingFactory::class)->all()
|
|
|
|
->map(fn ($setting) => [
|
|
|
|
'url' => $setting->url(),
|
|
|
|
'is_active' => get_class($setting) === $active,
|
|
|
|
'title' => $setting->title(),
|
|
|
|
])->toArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return <<<'HTML'
|
2024-10-25 00:46:03 +02:00
|
|
|
<x-page::layout :title="$active::title()">
|
2024-10-14 20:25:11 +02:00
|
|
|
<x-slot:right>
|
2024-10-20 18:26:17 +02:00
|
|
|
{{ $right ?? '' }}
|
2024-10-14 20:25:11 +02:00
|
|
|
</x-slot:right>
|
2024-10-24 23:05:12 +02:00
|
|
|
<x-slot:toolbar>
|
|
|
|
{{ $toolbar ?? '' }}
|
|
|
|
</x-slot:toolbar>
|
2024-10-14 20:25:11 +02:00
|
|
|
<div class="flex grow relative">
|
|
|
|
<x-ui::menulist :entries="$entries"></x-ui::menulist>
|
2024-10-20 18:31:22 +02:00
|
|
|
<div class="grow">
|
|
|
|
{{ $slot }}
|
|
|
|
</div>
|
2024-10-14 20:25:11 +02:00
|
|
|
</div>
|
|
|
|
</x-page::layout>
|
|
|
|
HTML;
|
|
|
|
}
|
|
|
|
}
|