@props(['trend' => null, 'label' => null, 'showLabel' => false]) @php $tone = data_get($trend, 'trend_sentiment', data_get($trend, 'tone', 'neutral')); $toneColor = match ($tone) { 'positive' => '#61f2a9', 'negative' => '#ff7568', default => '#c8d2d7', }; @endphp @if ($trend) class(['trend-badge', 'trend-badge--' . $tone])->style(['--trend-color: ' . $toneColor]) }}> {{ data_get($trend, 'formatted_percent_delta', '0 %') }} @if ($showLabel && ($label ?? data_get($trend, 'label'))) {{ $label ?? data_get($trend, 'label') }} @endif @endif