You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

report-summary-section.blade.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. @props([
  2. 'reportLoaded' => false,
  3. 'summaryData' => [],
  4. 'targetLabel' => null,
  5. ])
  6. <div>
  7. <x-filament::section>
  8. @if($reportLoaded)
  9. <div class="flex flex-col md:flex-row items-center md:items-end text-center justify-center gap-4 md:gap-8">
  10. @foreach($summaryData as $summary)
  11. <div class="text-sm">
  12. <div class="text-gray-600 dark:text-gray-200 font-medium mb-2">{{ $summary['label'] }}</div>
  13. @php
  14. $isTargetLabel = $summary['label'] === $targetLabel;
  15. $isPositive = money($summary['value'], \App\Utilities\Currency\CurrencyAccessor::getDefaultCurrency())->isPositive();
  16. @endphp
  17. <strong
  18. @class([
  19. 'text-lg',
  20. 'text-green-700 dark:text-green-500' => $isTargetLabel && $isPositive,
  21. 'text-danger-700 dark:text-danger-500' => $isTargetLabel && ! $isPositive,
  22. ])
  23. >
  24. {{ $summary['value'] }}
  25. </strong>
  26. </div>
  27. @if(! $loop->last)
  28. <div class="flex items-center justify-center px-2">
  29. <strong class="text-lg">
  30. {{ $loop->remaining === 1 ? '=' : '-' }}
  31. </strong>
  32. </div>
  33. @endif
  34. @endforeach
  35. </div>
  36. @endif
  37. </x-filament::section>
  38. </div>