<% title = trans.cruds.MODULE.NOTIFICATION + ' ' + trans.global.view + ' - ' + companyInfo.NAME %>
<div class="container-fluid">
    <!-- Page Title -->
    <div class="page-title">
        <div class="row">
            <div class="col-sm-6 col-12">
                <h2><%= trans.cruds.MODULE.NOTIFICATION %></h2>
            </div>
            <div class="col-sm-6 col-12">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<%= '/admin/dashboard' %>"><i class="iconly-Home icli svg-color"></i> <%= trans.global.home %></a></li>
                    <li class="breadcrumb-item"><a href="<%= '/admin/notifications' %>"><%= trans.cruds.NOTIFICATION?.title %></a></li>
                    <li class="breadcrumb-item active"><%= trans.global.view %></li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid">
    <div class="edit-profile">
        <div class="row">
            <div class="col-xl-12">
                <!-- Card with Notification Details -->
                <div class="card">
                    <div class="card-header card-no-border pb-0">
                        <h3 class="card-title mb-0"><%= trans.cruds.MODULE.NOTIFICATION + ' ' + trans.global.view %></h3>
                    </div>
                    <div class="card-body">
                        <!-- Notification Details in Grid Layout -->
                        <div class="row">
                            <!-- Left Column -->
                            <div class="col-sm-6 col-md-6">
                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.title %>:</label>
                                    <span><%= notification.title || trans.global.not_available %></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.description %>:</label>
                                    <span><%- notification.description || trans.global.not_available %></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.notifyUrl %></label>
                                    <span><a href="<%= notification.notifyUrl %>" target="_blank"><%= notification.notifyUrl %></a></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.clickCount %></label>
                                    <span><%= notification.clickCount %></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.viewCount %></label>
                                    <span><%= notification.viewCount %></span>
                                </div>
                            </div>

                            <!-- Right Column -->
                            <div class="col-sm-6 col-md-6">
                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.deliveredAt %></label>
                                    <span><%= new Date(notification.deliveredAt).toLocaleString() %></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.readAt %></label>
                                    <span><%= notification.isRead ? 'Yes' : 'No' %> <%= notification.readAt ? '(' + new Date(notification.readAt).toLocaleString() + ')' : '' %></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.seen %></label>
                                    <span><%= notification.isSeen ? 'Yes' : 'No' %> <%= notification.seenAt ? '(' + new Date(notification.seenAt).toLocaleString() + ')' : '' %></span>
                                </div>

                                <div class="form-group mb-3">
                                    <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.sender %></label>
                                    <span><%= notification.senderId?.first_name %> <%= notification.senderId?.last_name %> (<%= notification.senderId?.email %>)</span>
                                </div>

                                <% if (notification?.recipientId) { %>
                                    <div class="form-group mb-3">
                                        <label class="form-label"><%= trans.cruds.NOTIFICATION.fields.recipient %></label>
                                        <span><%= notification.recipientId?.first_name %> <%= notification.recipientId?.last_name %> (<%= notification.recipientId?.email %>)</span>
                                    </div>
                                <% } %>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>