
                        window.location.href = `/view.html?id=${id}`;
                    }
                }, 100);
            }
        }

        const editModeButton = document.getElementById('edit-mode-button');
        const cancelEditButton = document.getElementById('cancel-edit');
        const saveEditButton = document.getElementById('save-edit');

        editModeButton.addEventListener('click', () => toggleEditMode(true));
        cancelEditButton.addEventListener('click', () => toggleEditMode(