@props([ 'headers' => [], 'paginator' => null, 'emptyMessage' => 'No data found.', 'emptyActionText' => null, 'emptyActionUrl' => null, ])
@if ($paginator && $paginator->count())
@foreach ($headers as $header) @endforeach {{ $slot }}
{{ $header }}
@if(method_exists($paginator, 'links'))
{{ $paginator->links() }}
@endif @else

{{ $emptyMessage }}

@if($emptyActionText && $emptyActionUrl) {{ $emptyActionText }} @endif
@endif
{{-- How to use it --}} {{-- @foreach ($assets as $asset) {{ $asset->name }} {{ $asset->product?->name ?? '—' }} {{ $asset->serial_number }} @if ($asset->vendor) {{ $asset->vendor->name }} @else @endif {{ $asset->department?->name ?? $asset->user?->staff?->department?->name ?? '__' }} ${{ number_format($asset->purchase_cost, 2) }} {{ \Carbon\Carbon::parse($asset->acquisition_date)->format('Y-m-d') }} @php $assetStatusKey = match ($asset->is_currently_in_use) { 'in_use' => 'success', 'in_store' => 'neutral', 'in_repair' => 'warn', default => 'neutral', }; $assetStatusLabel = match ($asset->is_currently_in_use) { 'in_use' => 'In Use', 'in_store' => 'In Store', 'in_repair' => 'In Repair', default => '—', }; @endphp {{ $assetStatusLabel }}
@endforeach
--}}