29 lines
		
	
	
		
			680 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			680 B
		
	
	
	
		
			PHP
		
	
	
	
| <?php
 | |
| 
 | |
| namespace App\View\Page;
 | |
| 
 | |
| 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;
 | |
|     }
 | |
| }
 |