Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

report-summary-section.blade.php 1.8KB

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