auditionadmin/resources/views/components/table/th.blade.php

21 lines
540 B
PHP

@props([
'first' => false,
'spacer_only' => false,
'sortable' => true
])
@php
$classes = ($first) ? 'pl-4 pr-3 sm:pl-0' : 'px-3';
$classes .= " py-3.5 text-left text-sm font-semibold text-gray-900";
$classes .= $sortable ? ' cursor-pointer select-none' : '';
if($spacer_only) $classes = 'relative py-3.5 pl-3 pr-4 sm:pr-0';
$atrib = [
'scope' => 'col',
'class' => $classes
];
@endphp
<th @if($sortable)@click="sortByColumn"@endif {{ $attributes->merge($atrib) }}>
{{ $slot }}
</th>