resources/views/livewire/recipes.blade.php: move recipe link to a component.
This commit is contained in:
parent
4628ce85ac
commit
3b71b0358b
2 changed files with 14 additions and 12 deletions
13
resources/views/components/recipe-link.blade.php
Normal file
13
resources/views/components/recipe-link.blade.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
@props(['recipe'])
|
||||
@php
|
||||
if ($recipe->spell) {
|
||||
$id = $recipe->spell->id;
|
||||
$type = 'spell';
|
||||
} else {
|
||||
$id = $recipe->craft->external_id;
|
||||
$type = 'item';
|
||||
}
|
||||
@endphp
|
||||
<x-wowhead-link :type="$type" :wh-id="$id" href="{{ route('recipe.show', [ 'recipe' => $recipe ]) }}">
|
||||
{{ $recipe->name }}
|
||||
</x-wowhead-link>
|
||||
|
|
@ -19,18 +19,7 @@
|
|||
@foreach($recipes as $recipe)
|
||||
<tr class="focus:outline-none text-sm leading-none text-gray-800 bg-white hover:bg-gray-100 border-b border-t border-gray-100">
|
||||
<td class="px-3 py-4">
|
||||
@php
|
||||
if ($recipe->spell) {
|
||||
$id = $recipe->spell->id;
|
||||
$type = 'spell';
|
||||
} else {
|
||||
$id = $recipe->craft->external_id;
|
||||
$type = 'item';
|
||||
}
|
||||
@endphp
|
||||
<x-wowhead-link :type="$type" :wh-id="$id" href="{{ route('recipe.show', [ 'recipe' => $recipe ]) }}">
|
||||
{{ $recipe->name }}
|
||||
</x-wowhead-link>
|
||||
<x-recipe-link :recipe="$recipe" />
|
||||
</td>
|
||||
<td class="px-3 py-4">
|
||||
<div class="flex items-center">
|
||||
|
|
|
|||
Reference in a new issue