@props(['video' => null, 'size' => 'medium']) @php $videoUrl = $video ? asset('storage/videos/' . $video->filename) : null; $thumbnailUrl = $video && $video->thumbnail ? asset('storage/thumbnails/' . $video->thumbnail) : ($video ? 'https://picsum.photos/seed/' . $video->id . '/640/360' : 'https://picsum.photos/seed/random/640/360'); $typeIcon = $video ? match($video->type) { 'music' => 'bi-music-note', 'match' => 'bi-trophy', default => 'bi-film', } : 'bi-film'; // Check if video is shorts $isShorts = $video && $video->isShorts(); // Check if current user is the owner of the video $isOwner = $video && auth()->check() && auth()->id() == $video->user_id; // Size classes $sizeClasses = match($size) { 'small' => 'yt-video-card-sm', default => '', }; @endphp
{{ $video->title ?? 'Video' }} @if($videoUrl) @endif @if($video && $video->duration) {{ gmdate('i:s', $video->duration) }} @endif @if($isShorts) SHORTS @endif
@if($video && $video->user && $video->user->avatar_url) {{ $video->user->name }} @endif

{{ $video->title ?? 'Untitled Video' }}

@if($video && $video->user)
{{ $video->user->name }}
@endif @if($video)
{{ number_format($video->view_count) }} views • {{ $video->created_at->diffForHumans() }}
@endif
@if($video) @endif