import { showToast } from '../utils/uiHelpers.js'; import { modalManager } from '../managers/ModalManager.js'; /** * CheckpointModal - Component for displaying checkpoint details * This is a basic implementation that can be expanded in the future */ export class CheckpointModal { constructor() { this.modal = document.getElementById('checkpointModal'); this.modalTitle = document.getElementById('checkpointModalTitle'); this.modalContent = document.getElementById('checkpointModalContent'); this.currentCheckpoint = null; // Initialize close events this._initCloseEvents(); } _initCloseEvents() { if (!this.modal) return; // Close button const closeBtn = this.modal.querySelector('.close'); if (closeBtn) { closeBtn.addEventListener('click', () => this.close()); } // Click outside to close this.modal.addEventListener('click', (e) => { if (e.target === this.modal) { this.close(); } }); } /** * Show checkpoint details in the modal * @param {Object} checkpoint - Checkpoint data */ showCheckpointDetails(checkpoint) { if (!this.modal || !this.modalContent) { console.error('Checkpoint modal elements not found'); return; } this.currentCheckpoint = checkpoint; // Set modal title if (this.modalTitle) { this.modalTitle.textContent = checkpoint.model_name || 'Checkpoint Details'; } // This is a basic implementation that can be expanded with more details // For now, just display some basic information this.modalContent.innerHTML = `