| 22 | |
| 23 | // Function to fetch and display data in nested modals |
| 24 | function displaySubModal(modalId, headerText, contentId) { |
| 25 | const subModal = document.getElementById(modalId); |
| 26 | const subModalHeader = subModal.querySelector('.modal-header'); |
| 27 | const subModalContent = subModal.querySelector('.modal-section-content'); |
| 28 | |
| 29 | // Set header text |
| 30 | subModalHeader.innerText = headerText; |
| 31 | |
| 32 | // Fetch data from VSCode API or any other source |
| 33 | vscode.postMessage({ type: 'fetchData', value: contentId }); |
| 34 | |
| 35 | // Show the sub-modal |
| 36 | subModal.style.display = "block"; |
| 37 | } |
| 38 | |
| 39 | window.addEventListener('message', event => { |
| 40 | const message = event.data; |