@props([ 'moduleConfig', 'availableFields', 'availableMatchFields' => [], 'activeJob' => null, 'routePrefix' => 'admin', 'defaultValues' => [], 'indexRouteName' => null, 'catalogLanguages' => collect(), 'supportsTranslation' => false, 'canTranslate' => false, ]) @php $moduleKey = $moduleConfig->key; $mappedAvailableFields = collect($availableFields)->map(function ($f) { $label = $f['label'] ?? ''; if (is_string($label) && str_starts_with($label, 'labels.')) { if (preg_match('/^labels\.([a-zA-Z0-9_]+)\s*\((.+)\)$/', $label, $matches)) { $label = __("labels.{$matches[1]}") . ' (' . $matches[2] . ')'; } else { $label = __($label); } } return array_merge($f, ['label' => $label]); })->values(); $mappedAvailableMatchFields = collect($availableMatchFields)->map(fn($f) => array_merge($f, ['label' => __($f['label'])]))->values(); @endphp @push('scripts') @endpush
@if($activeJob) {{-- One-at-a-time lockout — a job is still pending/processing. --}}
@else
{{-- Step 1: file picker --}}
@csrf
.csv, max {{ (int) config('bulk_upload.max_file_kb', 10240) / 1024 }}MB
{{-- Step 2: preview + mapping (hidden until preview succeeds) --}}

{{ __('labels.bulk_upload_mapping_title') }}

{{ __('labels.bulk_upload_csv_preview') }}

{{ __('labels.bulk_upload_field_mapping') }}

@csrf @foreach($defaultValues as $defaultKey => $defaultValue) {{-- Seller bulk upload passes seller_id as a trusted default instead of asking sellers to map it. --}} @endforeach {{-- Operation mode --}}
{{-- Target Locale — visible when operation = translation --}} @php $clientLanguages = $catalogLanguages; $defaultLocale = 'en'; @endphp
{{-- Match-by — only meaningful when operation = update --}} @if(!empty($availableMatchFields))
@endif {{-- Notify-on-finish: optional FCM + database + mail notification when the job lands in a terminal state. --}}
{{ __('labels.notify_me_when_finished') }}

@endif