Refactor header cell component to use a span instead of a button for sortable elements

This commit is contained in:
Anas Khalifa
2025-06-08 17:40:25 +03:00
parent bf8da412b2
commit b95e63eb9b
@@ -23,14 +23,14 @@
@endif
{{ $attributes->class(['fi-ta-header-cell px-3 py-3.5 sm:first-of-type:ps-6 sm:last-of-type:pe-6']) }}
>
<{{ $sortable ? 'button' : 'span' }}
<span
@if ($sortable)
aria-label="{{ trim(strip_tags($slot)) }}"
type="button"
wire:click="sortTable('{{ $name }}')"
@endif
@class([
'group flex w-full items-center gap-x-1',
'cursor-pointer' => $sortable,
'whitespace-nowrap' => ! $wrap,
'whitespace-normal' => $wrap,
match ($alignment) {
@@ -67,5 +67,5 @@
])
/>
@endif
</{{ $sortable ? 'button' : 'span' }}>
</span>
</th>