@props(['name', 'tone' => 'purple', 'icon' => 'image', 'alt' => '', 'pos' => null]) @php // Slot foto -> file di public/images/assets. Ganti file di sini kalau gambarnya diganti. $map = [ 'ai' => 'cluster-ai.webp', 'kit' => 'training-kit.webp', 'article' => 'inhouse-training.webp', 'topic1' => 'new-articles.webp', 'topic2' => 'online-training.webp', 'mdp1' => 'leadership-development.webp', 'mdp2' => 'manufacturing-training.webp', 'banking' => 'business-partnership.webp', 'comm' => 'corporate-training.webp', 'hse' => 'manufacturing-training.webp', 'hr' => 'illustrative-portrait.webp', 'leader' => 'leadership-development.webp', 'ops' => 'manufacturing-training.webp', 'it' => 'cluster-ai.webp', 'avatar' => 'illustrative-portrait.webp', ]; $src = null; if (isset($map[$name]) && file_exists(public_path('images/assets/'.$map[$name]))) { $src = asset('images/assets/'.$map[$name]); } elseif (file_exists(public_path("images/photos/{$name}.jpg"))) { $src = asset("images/photos/{$name}.jpg"); } @endphp @if ($src) {{ $alt }} @else
merge(['class' => "ph ph-{$tone}"]) }} role="img" aria-label="{{ $alt }}">
@endif