@model List<Note>
<div class="row">
    <div class="d-flex justify-content-between">
        <div class="d-flex align-items-center flex-wrap">
            <span class="ms-2 badge bg-success">@($"# of Notes: {Model.Count()}")</span>
        </div>
        <div>
                <button onclick="showAddNoteModal()" class="btn btn-primary btn-md mt-1 mb-1"><i class="bi bi-pencil-square me-2"></i>Add Note</button>
        </div>
    </div>
</div>
<div class="row vehicleDetailTabContainer">
    <div class="col-12">
        <div class="row mt-2 showOnPrint">
            <div class="d-flex">
                <img src="/defaults/lubelogger_logo.png" />
            </div>
        </div>
        <table class="table table-hover">
            <thead class="sticky-top">
                <tr class="d-flex">
                    <th scope="col" class="col-3">Description</th>
                    <th scope="col" class="col-9">Note</th>
                </tr>
            </thead>
            <tbody>
                @foreach (Note note in Model)
                {
                    <tr class="d-flex" style="cursor:pointer;" onclick="showEditNoteModal(@note.Id)">
                        @if (note.Pinned)
                        {
                            <td class="col-3"><i class='bi bi-pin-fill me-2'></i>@note.Description"</td>
                        } else
                        {
                            <td class="col-3">@note.Description</td>
                        }
                        <td class="col-9 text-truncate">@CarCareTracker.Helper.StaticHelper.TruncateStrings(note.NoteText, 100)</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>


<div class="modal fade" data-bs-focus="false" id="noteModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content" id="noteModalContent">
        </div>
    </div>
</div>