@extends('layouts.app') @section('title', __('Preview')) @php $type = $types[$analysis->analysis_type] ?? null; $charts = app(\App\Services\Charting\AnalysisChartBuilder::class)->build($analysis); $isAr = app()->getLocale() === 'ar'; @endphp @push('head') @endpush @section('content') {{-- Banner --}}
{{ __('Preview only — the client cannot see this yet.') }} ← {{ __('Back to editor') }}
{{-- Header --}}

{{ $type['label'] ?? $analysis->analysis_type }}

{{ $submission->original_name }}

{{ optional($submission->uploader)->name ?? '—' }} @if($analysis->finished_at) · {{ $analysis->finished_at->translatedFormat('j F Y') }} @endif

{{-- Summary --}} @if($analysis->summary)

{{ __('Executive summary') }}

{{ $analysis->summary }}

@endif {{-- KPIs --}} @if(!empty($analysis->kpis))

{{ __('Key indicators') }}

@foreach($analysis->kpis as $kpi) @php $trend = $kpi['trend'] ?? null; $trendCls = $trend === 'up' ? 'text-emerald-700 dark:text-emerald-300 bg-emerald-50 dark:bg-emerald-900/30' : ($trend === 'down' ? 'text-rose-700 dark:text-rose-300 bg-rose-50 dark:bg-rose-900/30' : ($trend === 'flat' ? 'text-slate-600 dark:text-slate-300 bg-slate-100 dark:bg-slate-800' : '')); @endphp
{{ $kpi['label'] ?? '' }}
@if($trend) @if($trend === 'up') ↑ @elseif($trend === 'down') ↓ @else → @endif @endif
{{ $kpi['value'] ?? '' }} {{ $kpi['unit'] ?? '' }}
@if(!empty($kpi['comment']))

{{ $kpi['comment'] }}

@endif @if(!empty($kpi['source_ref']))

{{ $kpi['source_ref'] }}

@endif
@endforeach
@endif {{-- Charts --}} @if(!empty($charts))

{{ __('Charts') }}

@foreach($charts as $c)

{{ $c['title'] }}

{!! $c['html'] !!}
@endforeach
@endif {{-- Detailed explanation --}} @if($analysis->explanation_html)

{{ __('Detailed explanation') }}

{!! $analysis->explanation_html !!}
@endif
@endsection