/** * @fileoverview Provides avatar image preview functionality. * This file handles: * - File selection event handling * - Image preview generation * - Real-time avatar preview updates */ /** * Generates a preview of the selected avatar image. * Reads the selected file and updates the preview image element. * @function * @param {Event} event - The file input change event * @param {FileList} event.target.files - The list of selected files */ function previewAvatar(event) { const [file] = event.target.files; if (file) { const reader = new FileReader(); reader.onload = function(e) { document.getElementById('avatarPreview').src = e.target.result; }; reader.readAsDataURL(file); } }