@extends('front.'.config('app.template', 'tendra').'.master') @section('body')
{{-- Back Link --}}
{{-- Story Info --}}
{{-- Cover Image --}} @if($story->cover_image) {{ $story->title }} @else
🎧
@endif

{{ $story->title }}

{{ $story->category->name ?? __('Uncategorized') }} @if($story->duration) • {{ $story->duration }} @endif • {{ $story->created_at->format('M d, Y') }}
@if($story->is_free) {{ __('Free') }} @else {{ config('payments.currency_symbol') }}{{ $story->price }} @endif
{{-- Rating Display --}} @if($averageRating)
@for($i = 1; $i <= 5; $i++) @endfor
{{ number_format($averageRating, 1) }} ({{ $totalRatings }} {{ __('ratings') }})
@endif
{!! nl2br(e($story->description)) !!}
{{-- Audio Player / Purchase Section --}} @if($userHasAccess) @if($story->audio_file)

{{ __('Listen to Story') }}

@endif @else
@if(!Auth::check())

{{ __('Sign in to access this story') }}

@elseif(!$story->is_free)

{{ __('Purchase this story to listen') }}

@endif
@endif {{-- User Rating (if has access) --}} @if(Auth::check() && $userHasAccess)

{{ __('Rate this Story') }}

@for($i = 1; $i <= 5; $i++) @endfor @if($userRating) {{ __('Your rating') }}: {{ $userRating->rating }}/5 @endif
@endif
{{-- Sidebar --}}
{{-- Comments Section --}} @if(Auth::check() && $userHasAccess)

{{ __('Add Comment') }}

@endif {{-- Existing Comments --}} @if($story->comments->count() > 0)

{{ __('Comments') }} ({{ $story->comments->count() }})

@foreach($story->comments as $comment)
{{ substr($comment->user->name, 0, 1) }}
{{ $comment->user->name }}
{{ $comment->created_at->diffForHumans() }}
{{ $comment->comment }}
@endforeach
@endif {{-- Related Stories --}} @if($relatedStories->count() > 0)

{{ __('Related Stories') }}

@foreach($relatedStories as $relatedStory)
@if($relatedStory->cover_image) {{ $relatedStory->title }} @else
🎧
@endif
{{ $relatedStory->title }}
@if($relatedStory->is_free) {{ __('Free') }} @else {{ config('payments.currency_symbol') }}{{ $relatedStory->price }} @endif
@endforeach
@endif
@endsection