@extends('layouts.app') @section('title', $post->title . ' — Comunidad') @section('content')
← Comunidad
{{-- Post principal --}}
@if($post->user->avatar_url) {{ $post->user->name }} @else {{ strtoupper(substr($post->user->name, 0, 1)) }} @endif
{{ $post->user->name }}
{{ $post->created_at->format('d/m/Y H:i') }}
@if($post->guide) {{ $post->guide->name }} @endif {{ ['tip' => '💡 Tip', 'question' => '❓ Pregunta', 'recipe' => '📋 Receta', 'review' => '⭐ Valoración'][$post->post_type] }}

{{ $post->title }}

{{ $post->content }}

{{-- Fotos --}} @php $images = $post->getImages(); @endphp @if(count($images) > 0)
@foreach($images as $img) Foto del post @endforeach
@endif {{-- Acciones --}}
@csrf
💬 {{ $post->comments->count() }} comentarios @if(auth()->user()->isAdmin() || (auth()->id() === $post->user_id && $post->comments->count() === 0))
@csrf @method('DELETE')
@endif
{{-- Comentarios --}}
Comentarios
{{ $post->comments->count() }}
@forelse($post->comments as $comment)
@if($comment->user->avatar_url) {{ $comment->user->name }} @else {{ strtoupper(substr($comment->user->name, 0, 1)) }} @endif
{{ $comment->user->name }} {{ $comment->created_at->diffForHumans() }}

{{ $comment->content }}

@if(auth()->id() === $comment->user_id || auth()->user()->isAdmin())
@csrf @method('DELETE')
@endif
@empty
Sin comentarios todavía — ¡sé el primero!
@endforelse {{-- Formulario nuevo comentario --}}
Añadir comentario
@csrf
Máximo 250 caracteres. No podrás editarlo después de publicarlo.
@error('content')
{{ $message }}
@enderror
@endsection