@if(!empty($landingComponent) and $landingComponent->enable) @php $statisticsBackgroundColor = "secondary"; $contents = []; if (!empty($landingComponent->content)) { $contents = json_decode($landingComponent->content, true); } if (!empty($contents['background_color'])) { $statisticsBackgroundColor = $contents['background_color']; } @endphp @push('styles_top') @endpush
@if(!empty($contents['statistics']) and is_array($contents['statistics'])) @foreach($contents['statistics'] as $statistic) @if(!empty($statistic['title']) and !empty($statistic['data_type']) and !empty($statistic['data_source'])) @php $statisticComponentFrontMixins = (new \App\Mixins\LandingBuilder\StatisticComponentFrontMixins()); $statisticValue = $statisticComponentFrontMixins->calculateStatisticData($statistic); $isNumber = is_numeric($statisticValue); @endphp
@if(!empty($statistic['icon']))
@svg("iconsax-{$statistic['icon']}", ['width' => '32px', 'height' => '32px', 'class' => "icons"])
@endif
@if($isNumber)

0

@else

{{ $statisticValue }}

@endif

{{ $statistic['title'] }}

@endif @endforeach @endif
@endif @push('scripts_bottom') @endpush