@extends('layouts.dashboard') @section('content') @php use App\Models\AdCampaign; /** * Admin → Campaigns → one placement. The moderation decision is about CONTENT, so this * page shows what the list row cannot: the creative at real size, the full copy, the dish * it sells, and the placement's moderation history. The row's own approve / reject / * refund / delete actions ride in the header band, wired to the exact same handlers. * Content fields save through /admin/campaigns/edit; saving never moves status — the * state machine (pending → approved → active once paid) belongs to moderation and payment. * * @var array $c campaign row (+ restaurant_*, owner_*, dish_*) * @var array $history moderation events, newest first, each with its actor * @var array $menuItems this restaurant's dishes for the sponsored-dish picker */ $status = (string) $c['status']; $statusPill = static function (string $s): string { return match ($s) { 'active', 'approved' => 'qm-pill-green', 'pending' => 'qm-pill-amber', 'rejected', 'expired' => 'qm-pill-red', default => 'qm-pill-grey', }; }; $decidedVerb = static function (string $action): string { return match ($action) { 'approve' => t('admin.campaigns.decided_approved'), 'reject' => t('admin.campaigns.decided_rejected'), 'mark_paid' => t('admin.campaigns.decided_marked_paid'), 'edit' => t('admin.campaigns.decided_edited'), default => ucfirst(str_replace('_', ' ', $action)), }; }; $placement = (string) $c['placement']; $isHouse = ($c['source'] ?? 'vendor') === 'house'; // The creative may be an MP4 (feature video band) — a