<style >
.card-headerr{
    padding-top: 0.6rem !important;
    padding-bottom: 0.65rem !important;
    padding: 0.5rem 0.6rem;
  
   }
</style>

<div class="table-responsive p-3 " >
<table id="example" class="table table-bordered align-middle" style="width:100%; ">
  @foreach($data as $list)
<div class="card " style="background-color: #f1f1f1; border: 1px solid #cdc8c8;">
  <div class="card-headerr px-3 py-0" style="background-color: #f1f1f1;border-bottom: 1px solid #cdc8c8;border-top: 1px solid #cdc8c8;  ">
      {{$list->user}}

      <span class="float-md-end">
        @if(in_array('nurse-notes-edit', $authRolePermissions))
        <button  data-id="{{ $list->id }}" class="btn btn-sm btn-outline-secondary edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
          <i class="bi bi-pencil-square"></i>
        </button>
         @endif 
         @if(in_array('notes-comments-create', $authRolePermissions))
         <button  data-id="{{ $list->id }}"  class="btn btn-sm btn-outline-secondary comment" data-bs-toggle="modal" data-bs-target="#commonModal" title="Comment">
          <i class="bi bi-chat"></i>
        </button>
         @endif 
        @if(in_array('nurse-notes-delete', $authRolePermissions))
        <a  data-url="{{route('nurse-notes.destroy',$list->id)}}" data-id="{{$list->id}}" class="btn btn-sm btn-danger deleteDataCustom" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
            <i class="bi bi-trash text-white"></i>
        </a>
         @endif 
   </span>
  </div>

  <div class="card-body px-3" style="background-color: #f1f1f1;padding-top: 10px;" >
    <h5 class="card-title">Note :</h5>
    <p class="card-text">{{$list->note}}</p>

    <h5 class="card-title">Comment :</h5>
    <p class="card-text">{{$list->comment}}</p>
  
  </div>

@if(count($list->comments) > 0)
  <div class="card-body px-3 " style="background-color: #f1f1f1; padding-top: 10px; bo">
    <h6 class="">Comments :-</h6>
    @foreach($list->comments as $comments)
    <p class="card-text">{{$comments->comment}} <span class="float-md-end">
     <span>Commented by : {{$comments->user->name}} (at : {{$comments->created_at}})</span>
     @if(in_array('notes-comments-delete', $authRolePermissions)) 
        <a  data-url="{{route('nurse-notes-comments.destroy',$comments->id)}}" data-id="{{$comments->id}}" class="btn btn-sm btn-outline-secondary  deleteDataCustom" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
            <i class="bi bi-trash "></i>
        </a>
        @endif
   </span></p>
    
  @endforeach
  </div>
  @endif
</div>
@endforeach

</table>


