@extends('layouts.app') @section('content')
{{-- Header --}}

Campañas

Crea y programa envíos por segmento
+ Nueva campaña
@if (session('status')) @endif @if (session('error')) @endif @php $empresa = auth()->user()->empresa; @endphp
{{-- Filtros --}}
Limpiar
{{-- Tabla --}}
@forelse($campanas as $c) @empty @endforelse
Nombre Canal Plantilla Programada para Tags Estado Acciones
{{ $c->nombre }} {{-- Meta en móvil --}} {{ $c->programada_para ? $c->programada_para->format('d-m-Y H:i') : '—' }} • {{ $c->plantilla?->nombre ?? '—' }}
{{ $c->canal }} {{ $c->plantilla?->nombre ?? '—' }} {{ $c->programada_para ? $c->programada_para->format('d-m-Y H:i') : '—' }} @php $tags = $c->tags ?? collect(); $max = 3; @endphp @if($tags->count())
@foreach($tags->take($max) as $t) {{ $t->nombre }} @endforeach @if($tags->count() > $max) +{{ $tags->count() - $max }} @endif
@else @endif
@php $map = [ 'borrador' => 'secondary', 'programada' => 'primary', 'enviando' => 'info', 'finalizada' => 'success', 'cancelada' => 'danger', ]; $color = $map[$c->estado] ?? 'secondary'; @endphp {{ ucfirst($c->estado) }} {{-- Tags en móvil --}} @php $tagsMobile = ($c->tags ?? collect()); @endphp @if($tagsMobile->count())
@foreach($tagsMobile->take(2) as $t) {{ $t->nombre }} @endforeach @if($tagsMobile->count() > 2) +{{ $tagsMobile->count() - 2 }} @endif
@endif
{{-- Desktop --}}
@if($empresa && $empresa->plan_activo)
@csrf
@else @endif Envíos Editar
@csrf @method('DELETE')
{{-- Mobile --}}
No hay campañas.
{{ $campanas->links() }}
@if(!$empresa || !$empresa->plan_activo)
Tu plan está inactivo. Para generar envíos necesitas un plan activo.
@endif
@endsection