@props([ 'items' => collect(), 'showHeader' => true, ]) @php $historyItems = $items instanceof \Illuminate\Support\Collection ? $items : collect($items); $gradientStops = $historyItems->values()->map(function ($item, $index) use ($historyItems) { $percent = $historyItems->count() > 1 ? round(($index / ($historyItems->count() - 1)) * 100, 1) : 0; return ($item->color ?? '#17a2b8') . ' ' . $percent . '%'; })->implode(', '); @endphp @include('components.company-history.fonts') @if($historyItems->isNotEmpty())
@if($showHeader)
{{ __('company_history.timeline_section_badge') }}

{{ __('company_history.timeline_section_title') }}

{{ __('company_history.timeline_section_subtitle') }}

@endif
{{ __('company_history.timeline_start') }}
@foreach($historyItems as $index => $item) @php $color = $item->color ?? '#17a2b8'; $position = in_array($item->position, ['left', 'right'], true) ? $item->position : ($index % 2 === 0 ? 'right' : 'left'); $title = method_exists($item, 'translate') ? ($item->translate('title') ?: $item->title) : $item->title; $titleUpper = $title ? locale_upper($title) : null; $content = method_exists($item, 'translate') ? ($item->translate('content') ?: $item->content) : $item->content; @endphp
{{ $item->year }} @if($item->quarter) {{ __('company_history.quarter_label_' . strtolower($item->quarter)) }} @endif
@if($titleUpper)

{{ $titleUpper }}

@endif @if($content)

{{ $content }}

@endif
@endforeach
{{ __('company_history.timeline_finish') }}
@once @push('styles') @endpush @push('scripts') @endpush @endonce @endif