@extends('layouts.admin') @section('content')
{{-- Header --}}

{{ __('Warehouse Overview') }}

{{ __('Manage your warehouses, including main and branch warehouses') }}

{{-- Stats Cards --}}

{{ __('Total Warehouses') }}

{{ $stats['total'] }}

{{ __('Main Warehouses') }}

{{ $stats['main'] }}

{{ __('Branch Warehouses') }}

{{ $stats['branch'] }}

{{ __('Low Stock Alerts') }}

{{ $stats['low_stock'] }}

{{-- Table Card --}}
{{-- Filters --}}
@if(auth()->user()->isSystemAdmin())
@endif
{{-- Table View (Desktop) --}} {{-- Card View (Mobile/Tablet) --}}
@forelse($warehouses as $warehouse)

{{ $warehouse->name }}

{{ $warehouse->address ?: __('No address provided') }}

@if($warehouse->type === 'main')
{{ __('Main') }}
@else
{{ __('Branch') }}
@endif

{{ __('Products') }}

{{ $warehouse->products_count ?? 0 }}

{{ __('Stock') }}

{{ (int)($warehouse->total_stock ?? 0) }}

{{ __('Status') }}

@if($warehouse->is_active)
{{ __('Active') }}
@else
{{ __('Disabled') }}
@endif
@if(auth()->user()->isSystemAdmin())

{{ __('Company') }}

{{ $warehouse->company->name ?? __('System') }}

@endif
@if($warehouse->is_active) @else @endif
@empty

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

@endforelse
{{-- Pagination --}}
{{ $warehouses->links('vendor.pagination.luxury') }}
{{-- Create/Edit Modal --}}

@csrf
@if(auth()->user()->isSystemAdmin())
@else @endif
{{-- Confirm Modals --}}

{{ __('Loading Data') }}...

@endsection