{{-- resources/views/filament/components/article-comparison.blade.php --}} {{-- Story 5-16: Side-by-side article translation comparison --}} {{-- Rendered inside Filament slide-over modal via modalContent() --}} @php $currentBlocks = $current->blocks ?? []; $counterpartBlocks = $counterpart->blocks ?? []; $maxCount = max(count($currentBlocks), count($counterpartBlocks)); /** * Check if a block's content fields are considered empty/missing. */ $isBlockEmpty = function (array $block): bool { $data = $block['data'] ?? []; $contentKeys = ['text', 'content', 'items', 'path', 'url', 'images']; foreach ($contentKeys as $key) { if (! array_key_exists($key, $data)) { continue; } $value = $data[$key]; if (is_null($value) || $value === '' || $value === []) { return true; } } return false; }; $localeLabels = ['fr' => 'Français', 'en' => 'English']; $localeBadgeColors = [ 'fr' => 'background:#dbeafe;color:#1e40af;border:1px solid #93c5fd;', 'en' => 'background:#dcfce7;color:#166534;border:1px solid #86efac;', ]; $blockTypeLabels = [ 'paragraph' => 'Paragraphe', 'classic' => 'Classique', 'heading' => 'Titre', 'list' => 'Liste', 'quote' => 'Citation', 'image' => 'Image', 'gallery' => 'Galerie', 'video' => 'Vidéo', 'link' => 'Lien', 'button' => 'Bouton', 'banner' => 'Bannière', 'kpi' => 'KPI', ]; @endphp