$(document).ready(function () {
    $('[data-toggle="tooltip"]').tooltip();
    $('[data-tooltip-toggle="tooltip"]').tooltip();

    // Initialize custom tooltips (data-toggle="tooltip-custom") with custom template
    $('[data-toggle="custom-tooltip"]').tooltip({
        html: true,
        template: '<div class="tooltip custom-tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
    });


});

// // Event listener to toggle the display of the notification dropdown when the notification button is clicked
// const notificationButton = document.getElementById("notificationButton");
// const notificationDropdown = document.getElementById(
//     "notificationDropdown"
// );
// notificationButton.addEventListener("click", function (event) {
//     if (notificationDropdown.style.display === "block") {
//         notificationDropdown.style.display = "none";
//     } else {
//         notificationDropdown.style.display = "block";
//     }
//     event.stopPropagation();
// });

// // Event listener to hide the notification dropdown when clicking outside of it
// document.addEventListener("click", function () {
//     notificationDropdown.style.display = "none";
// });

// // Function to mark a single notification as read and disable the button
// function markAsRead(button) {
//     const icon = button.parentElement.querySelector("i.fa-envelope");
//     if (icon) {
//         icon.classList.remove("fa-envelope");
//         icon.classList.add("fa-envelope-open");
//     }
//     button.disabled = true;
// }

// // Function to mark all notifications as read and disable all the "Mark As Read" buttons
// function markAsReadAction(button) {
//     const icon = button
//         .closest(".notification-item")
//         .querySelector("i.fa-envelope");
//     if (icon) {
//         icon.classList.remove("fa-envelope");
//         icon.classList.add("fa-envelope-open");
//     }
//     button.disabled = true;
// }
// document
//     .querySelectorAll(".mark-as-read-button")
//     .forEach(function (button) {
//         button.addEventListener("click", function (event) {
//             event.stopPropagation();
//             markAsReadAction(event.target);
//         });
//     });

// // Event listener to mark all notifications as read when the "Mark All As Read" button is clicked
// const markAllAsReadButton = document.getElementById(
//     "markAllAsReadButton"
// );
// markAllAsReadButton.addEventListener("click", function (event) {
//     document
//         .querySelectorAll(".mark-as-read-button")
//         .forEach(function (button) {
//             event.stopPropagation();
//             markAsReadAction(button);
//         });
//     markAllAsReadButton.disabled = true;
// });



function displayUserPanel() {
    const savedImageSource = localStorage.getItem('selectedImage');
    const defaultIcon = document.getElementById('defaultIcon');
    const uploadedImage = document.getElementById('uploadedImage');

    if (savedImageSource) {
        // Hide the default icon and display the uploaded image
        defaultIcon.style.display = 'none';
        uploadedImage.src = savedImageSource;
        uploadedImage.style.display = 'block';
    }
}
