<div class="container-xxl flex-grow-1 container-p-y">
    
    <div class="row mx-1 my-1">
        <div class="col-md-9">
            <h4 class="fw-bold py-3 mb-4">Product <span class="text-muted fw-light">/ Detail</span></h4>
        </div>
    </div>

    <div class="row mx-1 my-1">
        <div class="card">
            <div class="card-body">
                @include('admin.partials.company-overview', array('company' => $product->company))
                <hr>
                <div class="table-responsive text-wrap mt-4">
                    <h4><strong>Product Detail</strong></h4>
                    <table class="table">
                        <tr>
                            <th>ID</th>
                            <td>{{ $product->id ?? "" }}</td>
                            <th>Name</th>
                            <td>{{ $product->name ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>Category</th>
                            <td>{{ $product->category->name ?? "" }}</td>
                            <th>Added on</th>
                            <td>{{ $product->created_at->format('d M, Y') ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>Type</th>
                            <td>{{ $product->type ?? "" }}</td>
                            <th>Stock Location</th>
                            <td>{{ $product->stock_location ?? "N/A" }}</td>
                        </tr>
                        <tr>
                            <th>Unit Type</th>
                            <td>{{ $product->unit_type ?? "" }}</td>
                            <th>Unit Size</th>
                            <td>{{ $product->unit_size ?? "N/A" }}</td>
                        </tr>
                        <tr>
                            <th>Unit/Case</th>
                            <td>{{ $product->unit_per_case ?? "" }}</td>
                            <th>Quantity</th>
                            <td>{{ $product->quantity ?? "N/A" }}</td>
                        </tr>
                        <tr>
                            <th>Price</th>
                            <td>{{ $product->is_contact_company == 1 ? "Contact Company" : ($product->currency.$product->price) }}</td>
                            <th>Expiry Date</th>
                            <td>{{ $product->expiry_date ?? "N/A" }}</td>
                        </tr>
                        <tr>
                            <th>Description</th>
                            <td colspan="3">{{ $product->description ?? "" }}</td>
                        </tr>
                        <tr>
                            <th>Images</th>
                            <td colspan="3">
                                @forelse($product->productImages as $img)
                                    <img src="{{ $img->file ?? asset('images/placeholder.png') }}" style="border-radius: 10%; margin-right:10px;" alt="product image" height="130px">
                                @empty
                                    <p>No images added</p>
                                @endforelse
                            </td>
                        </tr>
                    </table>   
                </div>
            </div>
        </div>
    </div>
</div>