{{-- Table Header Cell Component - shadcn-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([ 'h-10 px-4 font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', $alignClass, 'cursor-pointer select-none hover:text-foreground transition-colors duration-150' => $sortable, ]) }} @if($sortable && $sortKey) wire:click="sort('{{ $sortKey }}')" @endif >
{{ $slot }} @if($sortable) @if($isSorted) @if($currentDirection === 'asc') @else @endif @else @endif @endif