{{-- Simple Icons sprite needed for network chip icons in the Network Defaults section. --}} @include('partials.social-icons') @php // Client-side open seed — deferred $set (arg 3 = false) never fires /livewire/update. $blank = ['editingId' => null, 'name' => '', 'description' => '', 'platform_id' => null, 'showModal' => true]; @endphp {{-- All-categories options for rfSS searchable select (network chip defaults). Rendered on every page load so the JS variable is available before Alpine initialises the rfSS components when the Network Defaults tab is opened. --}} @once @endonce {{-- Tab switcher --}}
{{-- ══════════════════════════════════════════════════════════════ TAB: CATEGORIES (existing list) ══════════════════════════════════════════════════════════════ --}} @if ($tab === 'categories')

{{ __('Categories') }}

{{ trans_choice(':count category|:count categories', $categories->total(), ['count' => number_format($categories->total())]) }}
@forelse ($categories as $c) @php $edit = ['editingId' => $c->id, 'name' => $c->name, 'description' => (string) $c->description, 'platform_id' => $c->platform_id, 'showModal' => true]; @endphp @empty @endforelse
{{ __('Name') }} {{ __('Platform') }} {{ __('Services') }} {{ __('Status') }} {{ __('Action') }}
{{ $c->name }}
@if ($c->description)
{{ \Illuminate\Support\Str::limit($c->description, 60) }}
@endif
{{ $c->platform?->name ?? '—' }} {{ number_format($c->services_count) }}
@if ($categories->hasPages())
{{ $categories->links() }}
@endif
@endif {{-- ══════════════════════════════════════════════════════════════ TAB: NETWORK DEFAULTS Map each social network platform to its "landing" category: the category that auto-selects when a client clicks the network chip on the IMPULSA order screen. ══════════════════════════════════════════════════════════════ --}} @if ($tab === 'network_defaults') {{-- ══ Network Chip Defaults (per slug — works even without a DB platform) ══ --}}

{{ __('Network Chip Defaults') }}

{{ __('Choose which category loads when a client clicks each social network chip. This works even when all services are grouped under a single platform (e.g. "Other").') }}

@if ($allCategories->isEmpty()) @else
@foreach ($networkRegistry as $slug => $meta) @php $currentVal = (int) ($slugDefaults[$slug] ?? 0); // Use platform-specific categories if available; fall back to all categories. $hasPlatformOpts = array_key_exists($slug, $platformCatsBySlug); // No LIMIT when using platform-specific list (usually ≤50 items). $chipLimit = $hasPlatformOpts ? 9999 : 20; @endphp
{{-- Network header --}}
@if ($meta['sprite']) @elseif (! empty($meta['lucide'])) @else {{ $meta['mono'] }} @endif {{ $meta['label'] }} @if ($currentVal > 0) @endif
{{-- rfSS searchable select — replaces native
{{-- Options list --}}
  • {{ __('No results') }}
{{-- "More" hint when results are truncated --}}
{{-- /rfSS --}} @endforeach
@endif @endif {{-- ══════════════════════════════════════════════════════════════ MODAL: Create / Edit category (shared across both tabs) ══════════════════════════════════════════════════════════════ --}}
@error('name')

{{ $message }}

@enderror