adrema/modules/Base/Components/Page/MenuEntry.php

29 lines
695 B
PHP
Raw Normal View History

2024-09-23 23:49:17 +02:00
<?php
2024-09-24 01:26:08 +02:00
namespace Modules\Base\Components\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;
}
}