@props(['comparison' => null, 'label' => null]) {{-- One comparison table for every report: current, previous, change and its percent --}} @if ($comparison)

{{ $comparison['data']['title'] }}

{{ $label ?? 'دوره قبل: '.$comparison['from'].' تا '.$comparison['to'] }}
@if (count($comparison['data']['rows']))
@foreach ($comparison['data']['columns'] as $heading)@endforeach @foreach ($comparison['data']['rows'] as $row) @php $tone = $row['positive'] ? 'text-emerald-600' : ($row['negative'] ? 'text-rose-600' : 'text-slate-500'); @endphp @endforeach
{{ $heading }}
{{ $row['metric'] }} {{ rm_num($row['current'], 2) }} {{ rm_num($row['previous'], 2) }} {{ $row['positive'] ? '+' : '' }}{{ rm_num($row['delta'], 2) }} @if ($row['percent'] === null) - @else {{ $row['positive'] ? '+' : '' }}{{ rm_num($row['percent'], 1) }}% @endif
@else @endif
@endif