@extends('layouts.app') {{-- Use your main layout file --}} @section('title', $product->name) {{-- Use product name for title --}} @section('content') {{-- Back Navigation Link --}}
← Back to Products List
{{-- Main Content Container --}}
{{-- Flex container for image and details --}} {{-- Product Image --}}
@if ($product->image_url) {{ $product->name }} {{-- Link to actual product page on Amazon? --}} @if ($product->product_url) View on Amazon → @endif @else {{-- Placeholder if no image --}}
{{-- Placeholder SVG --}}
@endif
{{-- Product Details --}}
{{-- Title --}}

{{ $product->name }}

{{-- Core Details --}}
ASIN
{{ $product->asin ?? 'N/A' }}
Type
{{ $product->type ?? 'N/A' }}
Price
${{ number_format($product->price ?? 0, 2) }}
Status
{{-- Assuming 'availability' field exists, adjust if needed --}} @if ($product->availability ?? true) Available @else Not Available @endif
Added On
{{ $product->created_at->format('M d, Y') }}
Last Updated
{{ $product->updated_at->diffForHumans() }}
{{-- Description --}} @if ($product->description)

Description

{!! nl2br(e($product->description)) !!}
@endif {{-- Associated Campaigns --}}

Associated Campaigns

{{-- Use flex-wrap for badges --}} @forelse ($product->campaigns as $campaign) {{ $campaign->title }} @empty

Not associated with any campaigns.

@endforelse
{{-- Link to manage associations --}} @if ($product->campaign) {{-- Check if the direct belongsTo relationship exists --}} Manage Associations for primary campaign ({{ $product->campaign->title }}) → @else @if ($product->campaigns->first()) Manage Associations via campaign '{{ $product->campaigns->first()->title }}' → @endif @endif
{{-- Action Buttons --}}
{{-- Conditionally show Edit button --}} {{-- Assuming 'inhouse' is the type for conventional/editable products --}} @if ($product->type === 'inhouse') {{-- <<< ADDED THIS @if CONDITION --}} Edit Product @endif {{-- <<< END @if CONDITION --}} {{-- Delete button (kept for all types for now) --}}
@csrf @method('DELETE')
{{-- End Product Details Column --}}
{{-- End Flex Container --}}
{{-- End Main Content Container --}} @endsection