@if ($post->user->profile_picture)

@else
@php
$colors = ['bg-blue-500', 'bg-green-500', 'bg-red-500', 'bg-yellow-500', 'bg-purple-500', 'bg-pink-500', 'bg-indigo-500'];
$colorIndex = crc32($post->user->name) % count($colors);
$selectedColor = $colors[$colorIndex];
$nameParts = explode(' ', $post->user->name);
$initials = count($nameParts) > 1
? strtoupper(substr($nameParts[0], 0, 1)) . strtoupper(substr(end($nameParts), 0, 1))
: strtoupper(substr($nameParts[0], 0, 1));
@endphp
{{ $initials }}
@endif
@{{ $post->user->username }}
{{ $post->created_at->diffForHumans() }}
{{ $post->comments_count }} Comments