{{-- Table View (Desktop) --}} {{-- Card View (Mobile & Tablet) --}}
@forelse($machines as $machine) @php $maxStock = $machine->slots->sum('max_stock') ?: 1; $currentStock = (int)($machine->total_stock ?? 0); $fillRate = round(($currentStock / $maxStock) * 100); $fillColor = $fillRate >= 50 ? 'emerald' : ($fillRate >= 20 ? 'amber' : 'rose'); @endphp
@if($machine->image_urls && isset($machine->image_urls[0])) @else @endif

{{ $machine->name }}

{{ $machine->serial_no }}

{{ $fillRate }}%

{{ __('Total Slots') }}

{{ $machine->total_slots ?? 0 }}

{{ __('Total Stock') }}

{{ $currentStock }}

{{ __('Stock Rate') }}

{{ __('Replenish') }}
@empty

{{ __('No machines found') }}

@endforelse
@if($machines->total() > 0) {{ $machines->links('vendor.pagination.luxury') }} @else
{{ __('No records found') }} 0 / 0
@endif