{{-- Tabbed description + insights box. Expects: $video (Video model) Optionally accepts: $descriptionSlot — raw HTML to show in the About tab body --}} @php $isVideoOwner = Auth::check() && Auth::id() === $video->user_id; $hasDesc = !empty($video->description) || isset($descriptionSlot); $showBox = $hasDesc || $isVideoOwner; $fullDescription = $video->description ?? ''; $shortDescription = Str::limit($fullDescription, 200); $needsExpand = strlen($fullDescription) > 200; @endphp @if ($showBox)
@if($isVideoOwner) @endif
{{ number_format($video->view_count) }} views {{ $video->created_at->format('M d, Y') }} @if($video->duration){{ $video->formatted_duration }}@endif
@if(isset($descriptionSlot)) {!! $descriptionSlot !!} @elseif($hasDesc)
{{ $needsExpand ? $shortDescription : $fullDescription }}
@if($needsExpand) @endif @else

No description added.

@endif
@if($isVideoOwner) @endif
@endif