@props(['experience', 'periodLabel' => 'Période']) @php $level = data_get($experience, 'level', []); $accent = data_get($level, 'color', '#57d39b'); $format = fn (mixed $value): string => $value === null ? '—' : rtrim(rtrim(number_format((float) $value, 2, ',', ' '), '0'), ','); $periodBestIsAllTime = data_get($experience, 'period_best') !== null && (float) data_get($experience, 'period_best') === (float) data_get($experience, 'all_time_best'); $formatPercent = function (mixed $value): string { if ($value === null) return '—'; return ((float) $value > 0 ? '+' : '').number_format((float) $value, 1, ',', ' ').' %'; }; $percentTone = fn (mixed $value): string => $value === null || (float) $value === 0.0 ? 'neutral' : ((float) $value > 0 ? 'positive' : 'negative'); @endphp
class(['dashboard-panel', 'score-overview-card'])->style([ '--score-accent: '.$accent, '--score-progress: '.data_get($experience, 'progress_percent', 0).'%', ]) }} >

{{ __('Score du jour') }}

@if (data_get($experience, 'is_calculable', true)) {{ $format(data_get($experience, 'score')) }} {{ __('points') }} @else {{ __('non calculable') }} @endif
{{ data_get($level, 'label') }}
{{ __('Progression') }} {{ data_get($experience, 'is_calculable', true) ? $format(data_get($experience, 'score')).' / '.data_get($experience, 'maximum_label', 100) : __('Non calculable') }}
{{ __('Moyenne') }} {{ $format(data_get($experience, 'period_average')) }} {{ $periodLabel }} {{ $formatPercent(data_get($experience, 'percent_vs_period_average')) }} {{ __('vs moyenne') }}
{{ __('Classement') }} #{{ data_get($experience, 'period_rank') ?? '—' }} / {{ data_get($experience, 'period_count', 0) }} {{ $periodLabel }} Top {{ $formatPercent(data_get($experience, 'period_rank_percent')) }}
{{ __('Record période') }} {{ $format(data_get($experience, 'period_best')) }} @if (data_get($experience, 'is_all_time_record')) {{ __('Record absolu') }} @elseif (data_get($experience, 'is_period_record')) {{ __('Score actuel') }} @else {{ $periodLabel }} @endif {{ $formatPercent(data_get($experience, 'percent_vs_period_record')) }} {{ __('vs record') }}
{{ __('Record all-time') }} {{ $format(data_get($experience, 'all_time_best')) }} {{ __('Toutes périodes') }} {{ $formatPercent(data_get($experience, 'percent_vs_all_time_record')) }} {{ __('vs record') }}