{{-- Table Header Cell Component - TailAdmin style --}} @props([ 'align' => 'start', 'sortable' => false, 'sortKey' => null, 'currentSort' => null, 'currentDirection' => 'asc', ]) @php $alignClasses = [ 'start' => 'text-left', 'center' => 'text-center', 'end' => 'text-right', ]; $alignClass = $alignClasses[$align] ?? $alignClasses['start']; $isSorted = $sortable && $sortKey === $currentSort; @endphp class([ 'px-5 py-3.5 text-theme-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400', $alignClass, 'cursor-pointer select-none transition-colors duration-150 hover:text-gray-700 dark:hover:text-gray-300' => $sortable, ]) }} @if($sortable && $sortKey) wire:click="sort('{{ $sortKey }}')" @endif >
{{ $slot }} @if($sortable) @if($isSorted) @if($currentDirection === 'asc') @else @endif @else @endif @endif