<?php if (isset($component)) { $__componentOriginal1a6cca1fb3b05e19b47840b98800a235 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1a6cca1fb3b05e19b47840b98800a235 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.layouts.dashboard','data' => ['title' => $config['title']]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('layouts.dashboard'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($config['title'])]); ?>
    <?php ($routePrefix = $routePrefix ?? 'admin'); ?>
    <div class="toolbar">
        <a class="btn" href="<?php echo e(route($routePrefix.'.'.$module.'.create')); ?>">Add <?php echo e($config['singular']); ?></a>
        <form class="inline-filter" method="get">
            <input name="search" value="<?php echo e($search ?? ''); ?>" placeholder="Search <?php echo e(strtolower($config['title'])); ?>">
            <select name="status">
                <option value="">All status</option>
                <?php $__currentLoopData = ['active','inactive','pending','in_progress','submitted','approved','revision_required','completed']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $choice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($choice); ?>" <?php if(($status ?? '') == $choice): echo 'selected'; endif; ?>><?php echo e(str($choice)->headline()); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <button class="ghost">Filter</button>
        </form>
    </div>
    <div class="table-card">
        <table>
            <thead>
                <tr>
                    <?php $__currentLoopData = $config['columns']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <th><?php echo e(str_replace('_', ' ', $column)); ?></th>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <?php $__currentLoopData = $config['columns']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $column): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <td>
                                <?php switch($column):
                                    case ('client_id'): ?>
                                        <?php echo e($item->client->name ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('user_id'): ?>
                                        <?php if(method_exists($item, 'client')): ?>
                                            <?php echo e($item->client->name ?? '-'); ?>

                                        <?php else: ?>
                                            <?php echo e($item->user->name ?? '-'); ?>

                                        <?php endif; ?>
                                        <?php break; ?>
                                    <?php case ('designer_id'): ?>
                                        <?php echo e($item->designer->name ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('plan_id'): ?>
                                        <?php echo e($item->plan->name ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('service_id'): ?>
                                    <?php case ('gts_service_id'): ?>
                                        <?php echo e($item->service->name ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('gts_provider_id'): ?>
                                        <?php echo e($item->provider->name ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('gts_wallet_id'): ?>
                                        <?php echo e($item->wallet->user->name ?? 'Wallet #'.$item->gts_wallet_id); ?>

                                        <?php break; ?>
                                    <?php case ('payment_method_id'): ?>
                                        <?php echo e($item->paymentMethod->name ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('client_request_id'): ?>
                                        <?php echo e($item->request->title ?? '-'); ?>

                                        <?php break; ?>
                                    <?php case ('status'): ?>
                                        <span class="badge status-<?php echo e(str((string) data_get($item, $column))->slug()); ?>"><?php echo e(str((string) data_get($item, $column))->headline()); ?></span>
                                        <?php break; ?>
                                    <?php case ('progress'): ?>
                                        <div class="progress"><i style="width:<?php echo e((int) data_get($item, $column)); ?>%"></i></div>
                                        <?php break; ?>
                                    <?php default: ?>
                                        <?php if(in_array($column, ['paid_at', 'deadline', 'starts_at', 'ends_at'], true)): ?>
                                            <?php echo e(data_get($item, $column)?->format('M j, Y') ?? '-'); ?>

                                        <?php else: ?>
                                            <?php if(in_array($column, ['last_synced_at', 'api_submitted_at', 'api_synced_at'], true)): ?>
                                                <?php echo e(data_get($item, $column)?->format('M j, Y H:i') ?? '-'); ?>

                                            <?php else: ?>
                                                <?php if(in_array($column, ['auto_submit', 'refill_enabled', 'dripfeed_enabled'], true)): ?>
                                                    <span class="badge status-<?php echo e(data_get($item, $column) ? 'active' : 'inactive'); ?>"><?php echo e(data_get($item, $column) ? 'On' : 'Off'); ?></span>
                                                <?php else: ?>
                                                    <?php echo e(data_get($item, $column)); ?>

                                                <?php endif; ?>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                <?php endswitch; ?>
                            </td>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <td class="actions">
                            <?php if($routePrefix === 'admin' && $module === 'clients'): ?><a class="ghost small" href="<?php echo e(route('admin.clients.profile', $item)); ?>">View</a><?php endif; ?>
                            <?php if($routePrefix === 'admin' && $module === 'designers'): ?><a class="ghost small" href="<?php echo e(route('admin.designers.profile', $item)); ?>">View</a><?php endif; ?>
                            <?php if($module === 'requests' && $item->file_path): ?><a class="ghost small" target="_blank" href="<?php echo e(asset('storage/'.$item->file_path)); ?>">File</a><?php endif; ?>
                            <?php if($module === 'payments' && $item->proof_path): ?><a class="ghost small" target="_blank" href="<?php echo e(asset('storage/'.$item->proof_path)); ?>">Proof</a><?php endif; ?>
                            <?php if($module === 'gts-wallet-transactions' && $item->proof_path): ?><a class="ghost small" target="_blank" href="<?php echo e(asset('storage/'.$item->proof_path)); ?>">Proof</a><?php endif; ?>
                            <?php if($module === 'gts-providers'): ?><form class="provider-sync-form" method="post" action="<?php echo e(route($routePrefix.'.gts-providers.sync', $item)); ?>"><?php echo csrf_field(); ?><input name="profit_percent" type="number" min="0" max="1000" step="0.01" value="30" title="Commission %"><button class="ghost small">Sync + Commission</button></form><?php endif; ?>
                            <?php if($module === 'gts-orders' && $item->provider_order_id): ?><form method="post" action="<?php echo e(route($routePrefix.'.gts-orders.sync', $item)); ?>"><?php echo csrf_field(); ?><button class="ghost small">Sync API</button></form><?php endif; ?>
                            <a class="ghost small" href="<?php echo e(route($routePrefix.'.'.$module.'.edit', $item->id)); ?>">Edit</a>
                            <form method="post" action="<?php echo e(route($routePrefix.'.'.$module.'.destroy', $item->id)); ?>"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="danger">Delete</button></form>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="<?php echo e(count($config['columns']) + 1); ?>">No records yet.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
        <?php echo e($items->links()); ?>

    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1a6cca1fb3b05e19b47840b98800a235)): ?>
<?php $attributes = $__attributesOriginal1a6cca1fb3b05e19b47840b98800a235; ?>
<?php unset($__attributesOriginal1a6cca1fb3b05e19b47840b98800a235); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1a6cca1fb3b05e19b47840b98800a235)): ?>
<?php $component = $__componentOriginal1a6cca1fb3b05e19b47840b98800a235; ?>
<?php unset($__componentOriginal1a6cca1fb3b05e19b47840b98800a235); ?>
<?php endif; ?>
<?php /**PATH E:\Websites\MGG\resources\views/admin/module-index.blade.php ENDPATH**/ ?>