<?php

use App\Models\ClientStickyNote;

$recentStickyNotes = ClientStickyNote::where('client_id', $patient->id)->orderBy('created_at', 'DESC')->limit(5)->get();
?>
<div moe relative center class="ml-2">
	<a start show><i class="fas fa-history fa-fw on-hover-opaque"></i></a>
	<form url="" class="mcp-theme-1">
		<div>
			<div class="d-flex align-items-center justify-content-between pb-2 mb-1">
				<h5 class="mb-0 font-weight-bold">Recent Sticky Notes</h5>
				<button cancel class="btn btn-sm btn-default border">
					<i class="fas fa-times"></i>
				</button>
			</div>
			@foreach($recentStickyNotes as $sn)
				<div class="border bg-light mt-2 p-2">
					<p class="mb-1"><?= nl2br($sn->sticky_note) ?></p>
					<div class="text-muted">
						<span>By: <b>{{ $sn->createdBy->pro->displayName() }}</b></span> - <span>{{ friendly_date_time($sn->created_at) }}</span>
					</div>
				</div>
			@endforeach
			@if(!count($recentStickyNotes))
				<div class="border-top p-3">
					<p class="text-center m-0">No records found</p>
				</div>
			@endif
		</div>
	</form>
</div>
