{{-- Reward Loyalty - Proprietary Software Copyright (c) 2025 NowSquare. All rights reserved. See LICENSE file for terms. Batch Management Dashboard - Jony Ive Edition Purpose: Central command center for managing voucher batches. Philosophy: QR code is HERO. Metrics are whispers. Actions are intuitive. Design: The batch card Apple would create if they did voucher systems. --}} @extends('partner.layouts.default') @section('page_title', trans('common.voucher_batches') . config('default.page_title_delimiter') . config('default.app_name')) @section('content')
{{-- Page Header --}} @if($hasVouchers) {{-- Partner has vouchers: Show import & generate batch buttons --}} {{-- --}} @else {{-- No vouchers yet: Direct to create first voucher --}} {{ trans('common.create_first_voucher') }} @endif {{-- Stats Overview — Premium card design matching Shopify integration --}}
{{-- Total Batches --}}

{{ trans('common.batches') }}

{{ $stats['total_batches'] }}

{{-- Total Codes --}}

{{ trans('common.codes') }}

{{ $stats['total_codes'] }}

{{-- Redeemed --}}

{{ trans('common.redeemed') }}

{{ $stats['codes_used'] }}

{{-- Usage Rate --}}

{{ trans('common.usage_rate') }}

{{ $stats['usage_rate'] }}%

{{-- Batch Grid — iOS Premium Edition --}} @if($batches->count() > 0)
@foreach($batches as $batch) @php $used = $batch->vouchers()->where('times_used', '>', 0)->count(); $usagePercent = $batch->vouchers_created > 0 ? round(($used / $batch->vouchers_created) * 100) : 0; @endphp
{{-- Card Header --}}
{{-- QR Button — Compact, elegant --}} {{-- Title + Meta --}}

{{ $batch->name }}

{{ $batch->created_at->format('M d, Y') }}

{{-- Status Badge --}} @php $statusConfig = match($batch->status) { 'active' => ['bg' => 'bg-emerald-500', 'ring' => 'ring-emerald-500/20', 'animate' => true], 'paused' => ['bg' => 'bg-amber-500', 'ring' => 'ring-amber-500/20', 'animate' => false], default => ['bg' => 'bg-secondary-400', 'ring' => 'ring-secondary-400/20', 'animate' => false], }; @endphp
{{-- Metrics Row — Clean typography, no boxes --}}
{{ $batch->vouchers_created }} {{ trans('common.created') }}
{{ $batch->claimed_count }} {{ trans('common.claimed') }}
{{ $used }} {{ trans('common.used') }}
{{ $usagePercent }}% {{ trans('common.rate') }}
{{-- Progress Bar — Subtle --}}
{{-- Actions — Border-top separation --}}
{{ trans('common.view_codes') }} {{-- QR Button --}} {{-- More Actions --}}
@endforeach
{{-- Pagination --}}
{{ $batches->links() }}
@else {{-- Empty State — Premium card design --}}
@if($hasVouchers) {{-- Has vouchers, no batches yet --}}

{{ trans('common.no_batches_yet') }}

{{ trans('common.create_first_batch_description') }}

{{ trans('common.generate_batch') }} @else {{-- No vouchers at all --}}

{{ trans('common.create_voucher_first') }}

{{ trans('common.create_voucher_first_description') }}

{{ trans('common.create_first_voucher') }} @endif
@endif
{{-- QR Modal Component (Event-Based) --}} @push('styles') @endpush @push('scripts') @endpush @endsection