/ resources / views / components / table / heading.blade.php
heading.blade.php
 1  @props([
 2      'sortable' => null,
 3      'direction' => null,
 4  ])
 5  
 6  <th {{ $attributes->merge(['class' => 'px-4 py-2 bg-primary-600']) }}>
 7      @unless($sortable)
 8          <a class="inline-block text-sm font-medium text-white">{{ $slot }}</a>
 9      @else
10          <a class="items-center text-sm font-medium text-white cursor-pointer">
11              {{ $slot }}
12  
13              @if ($direction === 'desc')
14                  <span class="px-1">
15                      <x-heroicon-s-chevron-up class="inline-block w-4 text-white align-middle" />
16                  </span>
17              @elseif ($direction === 'asc')
18                  <span class="px-1">
19                      <x-heroicon-s-chevron-down class="inline-block w-4 text-white align-middle" />
20                  </span>
21              @elseif ($direction === null)
22              @else
23              @endif
24          </a>
25      @endunless
26  </th>