@props([
    'columns' => [],
])

<thead>
    <tr>
        @foreach ($columns as $column)
            @php
                $label = is_array($column) ? ($column['label'] ?? '') : $column;
                $align = is_array($column) ? ($column['align'] ?? null) : null;
                $width = is_array($column) ? ($column['width'] ?? null) : null;
                $class = $align === 'end' ? 'text-end' : ($align === 'center' ? 'text-center' : '');
            @endphp
            <th @class([$class => $class]) @if ($width) style="width: {{ $width }}" @endif>
                {{ $label }}
            </th>
        @endforeach
    </tr>
</thead>
