@props([ 'columns' => [], 'rows' => [], 'sortBy' => '', 'sortDir' => 'asc', 'emptyMessage' => 'No records found.', ]) @php $wrap = 'overflow-x-auto rounded-xl border border-border'; $table = 'w-full text-left text-sm text-muted-foreground'; $thead = 'bg-brand text-xs font-semibold uppercase tracking-wider text-brand-foreground'; $th = 'px-6 py-4'; $tr = 'border-t border-border bg-card transition-colors duration-150 hover:bg-muted/60 dark:hover:bg-muted/40'; $td = 'px-6 py-4 text-foreground'; @endphp
@foreach($columns as $col) @endforeach @if(isset($actions)) @endif @forelse($rows as $row) @foreach($columns as $col) @endforeach @if(isset($actions)) @endif @empty @endforelse
@if($col['sortable'] ?? false) {{ $col['label'] }} @else {{ $col['label'] }} @endif Actions
{{ data_get($row, $col['key']) }} {{ $actions }}