@extends('admin.layout') @section('title', 'AI Agent') @section('content')
{{-- Header --}}

AI Content Agent

Automated content management powered by Claude AI

{{-- Task Cards --}}
@foreach($taskTypes as $type) @php $lastRun = $lastRuns[$type] ?? null; $label = $taskLabels[$type] ?? $type; $icon = $taskIcons[$type] ?? 'fa-cog'; $colors = [ 'generate_stories' => ['bg' => 'bg-indigo-50', 'text' => 'text-indigo-500', 'btn' => 'bg-indigo-500 hover:bg-indigo-600'], 'generate_articles' => ['bg' => 'bg-rose-50', 'text' => 'text-rose-500', 'btn' => 'bg-rose-500 hover:bg-rose-600'], 'update_sliders' => ['bg' => 'bg-purple-50', 'text' => 'text-purple-500', 'btn' => 'bg-purple-500 hover:bg-purple-600'], 'send_notifications' => ['bg' => 'bg-amber-50', 'text' => 'text-amber-500', 'btn' => 'bg-amber-500 hover:bg-amber-600'], 'discover_venues' => ['bg' => 'bg-emerald-50', 'text' => 'text-emerald-500', 'btn' => 'bg-emerald-500 hover:bg-emerald-600'], 'import_events' => ['bg' => 'bg-blue-50', 'text' => 'text-blue-500', 'btn' => 'bg-blue-500 hover:bg-blue-600'], ]; $color = $colors[$type] ?? ['bg' => 'bg-gray-50', 'text' => 'text-gray-500', 'btn' => 'bg-gray-500 hover:bg-gray-600']; @endphp

{{ $label }}

{{-- Last Run Status --}}
@if($lastRun)
Last run: @if($lastRun->status === 'completed') Completed @elseif($lastRun->status === 'failed') Failed @elseif($lastRun->status === 'running') Running @endif
{{ $lastRun->started_at?->diffForHumans() }} @if($lastRun->items_created > 0) {{ $lastRun->items_created }} items @endif
@else Never run @endif
{{-- Run Button --}}
@csrf
@endforeach
{{-- Activity Log --}}

Activity Log

{{ $logs->total() }} entries
@forelse($logs as $log) @empty @endforelse
Task Action Items Status Time Duration Details
{{ $taskLabels[$log->task_type] ?? $log->task_type }}
{{ $log->action }} @if($log->items_created > 0) {{ $log->items_created }} @else 0 @endif @if($log->status === 'completed') Completed @elseif($log->status === 'failed') Failed @elseif($log->status === 'running') Running @else {{ ucfirst($log->status) }} @endif {{ $log->started_at?->format('M d, H:i') ?? '-' }} {{ $log->duration ?? '-' }} @if($log->details) @else - @endif

No agent activity yet. Click "Run Now" on any task to get started.

@if($logs->hasPages())
{{ $logs->links() }}
@endif
@endsection ob_start();