<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
            <?php echo e(__('My Transactions')); ?>

        </h2>
     <?php $__env->endSlot(); ?>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <!-- Purchases (As Buyer) -->
            <?php if($buyerTransactions->count() > 0): ?>
                <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg mb-8">
                    <div class="p-6">
                        <h2 class="text-xl font-bold text-gray-900 dark:text-gray-100 mb-6">My Purchases</h2>
                        <div class="space-y-4">
                            <?php $__currentLoopData = $buyerTransactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="border border-gray-200 dark:border-gray-700 rounded-lg p-4 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
                                    <div class="flex items-center justify-between">
                                        <div class="flex items-center space-x-4">
                                            <div class="w-16 h-16 bg-gray-200 dark:bg-gray-700 rounded-lg overflow-hidden flex-shrink-0">
                                                <?php if($transaction->item->primaryPhoto): ?>
                                                    <img src="<?php echo e(asset($transaction->item->primaryPhoto->url)); ?>" alt="<?php echo e($transaction->item->title); ?>" class="w-full h-full object-cover">
                                                <?php else: ?>
                                                    <div class="w-full h-full flex items-center justify-center">
                                                        <span class="text-gray-400 dark:text-gray-500 text-xs">No Image</span>
                                                    </div>
                                                <?php endif; ?>
                                            </div>
                                            <div class="flex-1">
                                                <h3 class="font-semibold text-gray-900 dark:text-gray-100"><?php echo e($transaction->item->title); ?></h3>
                                                <p class="text-sm text-gray-600 dark:text-gray-400">Sold by <?php echo e($transaction->seller->name); ?></p>
                                                <div class="flex items-center space-x-4 mt-1">
                                                    <span class="text-lg font-bold text-green-600">$<?php echo e(number_format($transaction->price, 2)); ?></span>
                                                    <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium
                                                        <?php if($transaction->status === 'pending'): ?> bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-300
                                                        <?php elseif($transaction->status === 'completed'): ?> bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-300
                                                        <?php elseif($transaction->status === 'cancelled'): ?> bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-300
                                                        <?php else: ?> bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 <?php endif; ?>">
                                                        <?php echo e(ucfirst($transaction->status)); ?>

                                                    </span>
                                                </div>
                                                <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">
                                                    Transaction created <?php echo e($transaction->created_at->format('M j, Y')); ?>

                                                </p>
                                            </div>
                                        </div>
                                        
                                        <div class="flex flex-col items-end space-y-2">
                                            <!-- Status Indicators -->
                                            <?php if($transaction->tracking_number && !$transaction->buyer_confirmed): ?>
                                                <span class="inline-flex items-center text-xs text-blue-600 dark:text-blue-400">
                                                    <svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2M4 13h2m13-8l-8 5-8-5"></path>
                                                    </svg>
                                                    Shipped - Confirm Receipt
                                                </span>
                                            <?php elseif($transaction->buyer_confirmed): ?>
                                                <span class="inline-flex items-center text-xs text-green-600">
                                                    <svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                                                    </svg>
                                                    Completed
                                                </span>
                                            <?php else: ?>
                                                <span class="inline-flex items-center text-xs text-yellow-600 dark:text-yellow-400">
                                                    <svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                                                    </svg>
                                                    Awaiting Shipment
                                                </span>
                                            <?php endif; ?>
                                            
                                            <a href="<?php echo e(route('transactions.show', $transaction)); ?>" class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
                                                View Details
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
            <?php endif; ?>

            <!-- Sales (As Seller) -->
            <?php if($sellerTransactions->count() > 0): ?>
                <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg mb-8">
                    <div class="p-6">
                        <h2 class="text-xl font-bold text-gray-900 dark:text-gray-100 mb-6">My Sales</h2>
                        <div class="space-y-4">
                            <?php $__currentLoopData = $sellerTransactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="border border-gray-200 dark:border-gray-700 rounded-lg p-4 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
                                    <div class="flex items-center justify-between">
                                        <div class="flex items-center space-x-4">
                                            <div class="w-16 h-16 bg-gray-200 dark:bg-gray-700 rounded-lg overflow-hidden flex-shrink-0">
                                                <?php if($transaction->item->primaryPhoto): ?>
                                                    <img src="<?php echo e(asset($transaction->item->primaryPhoto->url)); ?>" alt="<?php echo e($transaction->item->title); ?>" class="w-full h-full object-cover">
                                                <?php else: ?>
                                                    <div class="w-full h-full flex items-center justify-center">
                                                        <span class="text-gray-400 dark:text-gray-500 text-xs">No Image</span>
                                                    </div>
                                                <?php endif; ?>
                                            </div>
                                            <div class="flex-1">
                                                <h3 class="font-semibold text-gray-900 dark:text-gray-100"><?php echo e($transaction->item->title); ?></h3>
                                                <p class="text-sm text-gray-600 dark:text-gray-400">Sold to <?php echo e($transaction->buyer->name); ?></p>
                                                <div class="flex items-center space-x-4 mt-1">
                                                    <span class="text-lg font-bold text-green-600">$<?php echo e(number_format($transaction->price, 2)); ?></span>
                                                    <span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium
                                                        <?php if($transaction->status === 'pending'): ?> bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-300
                                                        <?php elseif($transaction->status === 'completed'): ?> bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-300
                                                        <?php elseif($transaction->status === 'cancelled'): ?> bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-300
                                                        <?php else: ?> bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 <?php endif; ?>">
                                                        <?php echo e(ucfirst($transaction->status)); ?>

                                                    </span>
                                                </div>
                                                <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">
                                                    Transaction created <?php echo e($transaction->created_at->format('M j, Y')); ?>

                                                </p>
                                            </div>
                                        </div>
                                        
                                        <div class="flex flex-col items-end space-y-2">
                                            <!-- Status Indicators -->
                                            <?php if(!$transaction->tracking_number): ?>
                                                <span class="inline-flex items-center text-xs text-orange-600">
                                                    <svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2M4 13h2m13-8l-8 5-8-5"></path>
                                                    </svg>
                                                    Add Tracking Info
                                                </span>
                                            <?php elseif($transaction->tracking_number && !$transaction->buyer_confirmed): ?>
                                                <span class="inline-flex items-center text-xs text-blue-600 dark:text-blue-400">
                                                    <svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2M4 13h2m13-8l-8 5-8-5"></path>
                                                    </svg>
                                                    Shipped - Awaiting Confirmation
                                                </span>
                                            <?php else: ?>
                                                <span class="inline-flex items-center text-xs text-green-600">
                                                    <svg class="w-3 h-3 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                                                    </svg>
                                                    Completed
                                                </span>
                                            <?php endif; ?>
                                            
                                            <a href="<?php echo e(route('transactions.show', $transaction)); ?>" class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
                                                Manage
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
            <?php endif; ?>

            <!-- Empty State -->
            <?php if($buyerTransactions->count() === 0 && $sellerTransactions->count() === 0): ?>
                <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-6 text-center">
                        <svg class="mx-auto h-12 w-12 text-gray-400 dark:text-gray-500" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path>
                        </svg>
                        <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2 mt-4">No transactions yet</h3>
                        <p class="text-gray-600 dark:text-gray-400 mb-6">When you buy or sell items, your transactions will appear here.</p>
                        
                        <div class="flex justify-center space-x-4">
                            <a href="<?php echo e(route('items.index')); ?>" class="inline-flex items-center px-4 py-2 bg-blue-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-blue-700 transition ease-in-out duration-150">
                                Browse Items
                            </a>
                            <a href="<?php echo e(route('my-items.create')); ?>" class="inline-flex items-center px-4 py-2 bg-green-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-green-700 transition ease-in-out duration-150">
                                List an Item
                            </a>
                        </div>
                    </div>
                </div>
            <?php endif; ?>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH /var/www/html/resources/views/transactions/index.blade.php ENDPATH**/ ?>