@extends('layouts.temcomment')
<style>
    .display-comment .display-comment {
        margin-left: 40px
    }
</style>
@section('content')

<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-body">
                    <p><img src="/image/member.png" alt="" srcset="" width="5%"> โพสต์ของสมาชิกหมายเลข {{ $post->user_id }}</p>
                    <strong><p style="font-size:30px;">{{ $post->title }}</p></strong>
                    <strong><p style="font-size:20px;">{{ $post->body }}</p></strong>

                    <p>
                      <center>
                        <img src="/image/{{ $post->image }}" alt="" srcset="" width="60%">
                      </center>
                    <!-- {{ $post->image }} -->
                    </p>
                    <hr/>
                    <h4>Comments</h4>

                    @include('comment/_comment_replies', ['comments' => $post->comments, 'post_id' => $post->id])

                    <form method="post" action="{{ route('comment.add') }}">
                        @csrf
                        <div class="form-group">
                          
                            <input type="text" name="comment_body" class="form-control"/ required>
                            <input type="hidden" name="post_id" value="{{ $post->id }}" />
                        </div>

                        <div class="form-group">
                            <input type="submit" class="btn btn-primary delete_form" value="Comment" required/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection
