{{-- Table Header Cell Component - AdminLTE style --}} @props([ 'align' => 'start', 'sortable' => false, 'sortKey' => null, 'currentSort' => null, 'currentDirection' => 'asc', ]) @php $alignStyles = [ 'start' => 'text-align: left; justify-content: flex-start;', 'center' => 'text-align: center; justify-content: center;', 'end' => 'text-align: right; justify-content: flex-end;', ]; $alignStyle = $alignStyles[$align] ?? $alignStyles['start']; $isSorted = $sortable && $sortKey === $currentSort; @endphp class([ 'table-th-lte', 'table-th-lte-sortable' => $sortable, 'table-th-lte-sorted' => $isSorted, ]) }} @if($sortable && $sortKey) wire:click="sort('{{ $sortKey }}')" @endif >
{{ $slot }} @if($sortable) @if($isSorted) @if($currentDirection === 'asc') @else @endif @else @endif @endif