@extends('layouts.app') {{-- Use your main layout file --}} @section('title', 'Products Inventory') @section('content') {{-- Alpine component manages view mode and selected products --}}
{{-- Header Row: Title, Add Buttons, View Toggle --}}

Products Inventory

{{-- Add Buttons --}} + Add Conventional Product + Add Amazon Business Product {{-- View Toggle --}}
{{-- List View Button --}} {{-- Grid View Button --}}
{{-- Search Form --}}
Clear
{{-- Bulk Action Form --}}
@csrf @method('DELETE') {{-- Bulk Action Bar --}}
{{-- Container for List View (Table) --}}
@forelse ($products as $product) {{-- Actions Cell - Updated with Flexbox for alignment --}} @empty @endforelse
Image Name ASIN Type Price Status Actions
@if ($product->image_url) {{ $product->name }} @else
@endif
{{ $product->name }} {{ $product->asin ?? 'N/A' }} {{ $product->type ?? 'N/A' }} ${{ number_format($product->price ?? 0, 2) }} @if ($product->availability ?? true) Available@elseNot Available @endif {{-- Added flex items-center justify-end --}}
{{-- View Icon Link --}} View {{ $product->name }} {{-- Edit Icon Link --}} Edit {{ $product->name }} {{-- Delete Icon Button (inside form) --}} @csrf @method('DELETE') {{-- Added flex items-center to button for consistency if needed --}}
No products found matching your criteria.
{{-- Container for Grid/Card View --}}
@forelse ($products as $product) {{-- Product Card --}}
{{-- Checkbox Overlay --}}
{{-- Image Section (Link) --}} @if ($product->image_url) {{ $product->name }} @else
@endif
{{-- Content Section --}}

{{ $product->name }}

ASIN: {{ $product->asin ?? 'N/A' }}

Type: {{ $product->type ?? 'N/A' }}

Price: ${{ number_format($product->price ?? 0, 2) }}

Status: @if ($product->availability ?? true) Available@elseNot Available @endif

{{-- Actions Section --}}
{{-- Increased spacing --}} {{-- View Icon Link --}} View {{-- Edit Icon Link --}} Edit {{-- Delete Icon Button (inside form) --}}
@csrf @method('DELETE')
@empty {{-- Empty State for Grid --}}

No products found matching your criteria.

Clear search criteria | Search & Add from Amazon?
@endforelse
{{-- End Bulk Action Form --}} {{-- Pagination Links (Outside form and conditional blocks) --}}
@if ($products instanceof \Illuminate\Pagination\LengthAwarePaginator) {{ $products->appends(request()->query())->links() }} @endif
{{-- End Alpine Component --}} @endsection