adrema/app/View/Page/MenuEntry.php

29 lines
680 B
PHP
Raw Normal View History

2024-09-23 23:49:17 +02:00
<?php
2024-10-13 21:00:47 +02:00
namespace App\View\Page;
2024-09-23 23:49:17 +02:00
use Illuminate\View\Component;
class MenuEntry extends Component
{
public function __construct(
public string $href,
public string $menu,
public string $icon,
) {
}
public function render()
{
return <<<'HTML'
<a class="flex text-white py-2 px-3 rounded-lg hover:bg-gray-600 {{ $menu === session('menu') ? 'bg-gray-700' : '' }}" href="{{$href}}">
<x-ui::sprite class="text-white w-6 h-6 mr-4" src="{{$icon}}"></x-ui::sprite>
<span class="font-semibold">
{{ $slot }}
</span>
</a>
HTML;
}
}