<?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 leading-tight">
            <?php echo e(__('My Sales')); ?>

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

    <div class="py-12">
        <div class="max-w-5xl mx-auto sm:px-6 lg:px-8">

            <?php if($transactions->count() === 0): ?>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="p-12 text-center">
                        <p class="text-gray-500 text-lg mb-2">No sales yet.</p>
                        <p class="text-gray-400 text-sm">Completed transactions where you're the seller will appear here.</p>
                        <a href="<?php echo e(route('items.my-listings')); ?>" class="mt-6 inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-semibold rounded-lg hover:bg-blue-700 transition">
                            View my listings
                        </a>
                    </div>
                </div>
            <?php else: ?>
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="divide-y divide-gray-100">
                        <?php $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php $item = $transaction->item; ?>
                            <div class="flex items-center gap-4 p-4">
                                
                                <div class="shrink-0">
                                    <div class="w-16 h-16 rounded-lg bg-gray-100 overflow-hidden">
                                        <?php if($item && $item->primaryPhoto): ?>
                                            <img src="<?php echo e(asset($item->primaryPhoto->url)); ?>" alt="<?php echo e($item->title); ?>" class="w-full h-full object-cover">
                                        <?php else: ?>
                                            <div class="w-full h-full flex items-center justify-center text-gray-300">
                                                <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                </div>

                                
                                <div class="flex-1 min-w-0">
                                    <p class="font-semibold text-gray-900 truncate">
                                        <?php echo e($item ? $item->title : 'Item deleted'); ?>

                                    </p>
                                    <?php if($transaction->buyer): ?>
                                        <p class="text-sm text-gray-500">Buyer: <?php echo e($transaction->buyer->name); ?></p>
                                    <?php endif; ?>
                                    <p class="text-xs text-gray-400 mt-0.5"><?php echo e($transaction->created_at->diffForHumans()); ?></p>
                                </div>

                                
                                <div class="shrink-0 text-right">
                                    <?php if($transaction->price): ?>
                                        <p class="font-semibold text-gray-900">$<?php echo e(number_format($transaction->price, 0)); ?></p>
                                    <?php endif; ?>
                                    <?php if($transaction->type): ?>
                                        <p class="text-xs text-gray-400"><?php echo e(ucfirst($transaction->type)); ?></p>
                                    <?php endif; ?>
                                </div>

                                
                                <div class="shrink-0">
                                    <?php
                                        $badgeClass = match($transaction->status) {
                                            'completed' => 'bg-green-100 text-green-800',
                                            'pending'   => 'bg-yellow-100 text-yellow-800',
                                            'cancelled' => 'bg-red-100 text-red-800',
                                            default     => 'bg-gray-100 text-gray-600',
                                        };
                                    ?>
                                    <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium <?php echo e($badgeClass); ?>">
                                        <?php echo e(ucfirst($transaction->status)); ?>

                                    </span>
                                </div>

                                
                                <?php if($transaction->tracking_number): ?>
                                    <div class="shrink-0 text-right">
                                        <p class="text-xs text-gray-500">Tracking</p>
                                        <p class="text-xs font-mono text-gray-700"><?php echo e($transaction->tracking_number); ?></p>
                                    </div>
                                <?php endif; ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>

                <div class="mt-4">
                    <?php echo e($transactions->links()); ?>

                </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/items/my-sales.blade.php ENDPATH**/ ?>